diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2024-04-03 12:31:29 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2024-04-11 09:38:17 +0200 |
commit | 7c885f8afa01235e91ca2c6dd635dcf3dcd2416f (patch) | |
tree | bd0926988dcc3b526d51012397c41ef93cdcddaf /drivers/gpu/drm/ast/ast_ddc.c | |
parent | c0cd6925856f661e1a37278660ccae551cef7077 (diff) |
drm/ast: Group DDC init code by data structure
Reorder the code to set up the DDC channel by data structure, so
that each data structure's init is in a separate block: first the
bit algo then the i2c adapter. Makes the code more readable. No
functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240403103325.30457-3-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_ddc.c')
-rw-r--r-- | drivers/gpu/drm/ast/ast_ddc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/ast/ast_ddc.c b/drivers/gpu/drm/ast/ast_ddc.c index 3e156a6b6831..4df52aeba4f7 100644 --- a/drivers/gpu/drm/ast/ast_ddc.c +++ b/drivers/gpu/drm/ast/ast_ddc.c @@ -145,15 +145,7 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast) return ERR_PTR(-ENOMEM); ddc->ast = ast; - adapter = &ddc->adapter; - adapter->owner = THIS_MODULE; - adapter->dev.parent = dev->dev; - i2c_set_adapdata(adapter, ddc); - snprintf(adapter->name, sizeof(adapter->name), "AST DDC bus"); - bit = &ddc->bit; - bit->udelay = 20; - bit->timeout = usecs_to_jiffies(2200); bit->data = ddc; bit->setsda = ast_ddc_algo_bit_data_setsda; bit->setscl = ast_ddc_algo_bit_data_setscl; @@ -161,8 +153,16 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast) bit->getscl = ast_ddc_algo_bit_data_getscl; bit->pre_xfer = ast_ddc_algo_bit_data_pre_xfer; bit->post_xfer = ast_ddc_algo_bit_data_post_xfer; + bit->udelay = 20; + bit->timeout = usecs_to_jiffies(2200); + adapter = &ddc->adapter; + adapter->owner = THIS_MODULE; adapter->algo_data = bit; + adapter->dev.parent = dev->dev; + snprintf(adapter->name, sizeof(adapter->name), "AST DDC bus"); + i2c_set_adapdata(adapter, ddc); + ret = i2c_bit_add_bus(adapter); if (ret) { drm_err(dev, "Failed to register bit i2c\n"); |