summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/ast/ast_ddc.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2024-03-25 21:06:53 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2024-04-02 10:40:49 +0200
commitd95e92e195a6ccb49faa27433bcbb654a3f79b1b (patch)
tree4541ee08e683da34ddf1b5a6ef7f980e6943fb39 /drivers/gpu/drm/ast/ast_ddc.c
parent0872fee2e1c8a0503006b5dab0ec32901b0bf247 (diff)
drm/ast: Store AST device in struct ast_ddc
The DDC code needs the AST device. Store a pointer in struct ast_ddc and avoid internal upcasts. Improves type safety within the DDC code. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240325200855.21150-9-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/ast/ast_ddc.c')
-rw-r--r--drivers/gpu/drm/ast/ast_ddc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/ast/ast_ddc.c b/drivers/gpu/drm/ast/ast_ddc.c
index 24b7d589f0d4..47670285fd76 100644
--- a/drivers/gpu/drm/ast/ast_ddc.c
+++ b/drivers/gpu/drm/ast/ast_ddc.c
@@ -30,7 +30,7 @@
static void ast_i2c_setsda(void *i2c_priv, int data)
{
struct ast_ddc *ddc = i2c_priv;
- struct ast_device *ast = to_ast_device(ddc->dev);
+ struct ast_device *ast = ddc->ast;
int i;
u8 ujcrb7, jtemp;
@@ -46,7 +46,7 @@ static void ast_i2c_setsda(void *i2c_priv, int data)
static void ast_i2c_setscl(void *i2c_priv, int clock)
{
struct ast_ddc *ddc = i2c_priv;
- struct ast_device *ast = to_ast_device(ddc->dev);
+ struct ast_device *ast = ddc->ast;
int i;
u8 ujcrb7, jtemp;
@@ -62,7 +62,7 @@ static void ast_i2c_setscl(void *i2c_priv, int clock)
static int ast_i2c_getsda(void *i2c_priv)
{
struct ast_ddc *ddc = i2c_priv;
- struct ast_device *ast = to_ast_device(ddc->dev);
+ struct ast_device *ast = ddc->ast;
uint32_t val, val2, count, pass;
count = 0;
@@ -84,7 +84,7 @@ static int ast_i2c_getsda(void *i2c_priv)
static int ast_i2c_getscl(void *i2c_priv)
{
struct ast_ddc *ddc = i2c_priv;
- struct ast_device *ast = to_ast_device(ddc->dev);
+ struct ast_device *ast = ddc->ast;
uint32_t val, val2, count, pass;
count = 0;
@@ -121,7 +121,7 @@ struct ast_ddc *ast_ddc_create(struct ast_device *ast)
ddc = drmm_kzalloc(dev, sizeof(*ddc), GFP_KERNEL);
if (!ddc)
return ERR_PTR(-ENOMEM);
- ddc->dev = dev;
+ ddc->ast = ast;
adapter = &ddc->adapter;
adapter->owner = THIS_MODULE;