Re: [PATCH v12 06/10] drm/bridge: Remove redundant i2c_client in anx7625/it6505
On Tue, Feb 21, 2023 at 5:51 PM Pin-yen Lin wrote: > > These two drivers embed a i2c_client in there private driver data, but This should be "their private driver data". I'll fix this in the next version. Pin-yen > only strict device is actually needed. Replace the i2c_client reference > with a struct device one. > > Signed-off-by: Pin-yen Lin > --- > > Changes in v12: > - New in v12 > > drivers/gpu/drm/bridge/analogix/anx7625.c | 96 > drivers/gpu/drm/bridge/analogix/anx7625.h | 2 +- > drivers/gpu/drm/bridge/ite-it6505.c | 128 +++--- > 3 files changed, 113 insertions(+), 113 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c > b/drivers/gpu/drm/bridge/analogix/anx7625.c > index 486b5099f5dd..cd628a2e2e50 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -207,7 +207,7 @@ static int anx7625_read_ctrl_status_p0(struct > anx7625_data *ctx) > > static int wait_aux_op_finish(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int val; > int ret; > > @@ -234,7 +234,7 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) > static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address, > u8 len, u8 *buf) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int ret; > u8 addrh, addrm, addrl; > u8 cmd; > @@ -427,7 +427,7 @@ static int anx7625_odfc_config(struct anx7625_data *ctx, >u8 post_divider) > { > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Config input reference clock frequency 27MHz/19.2MHz */ > ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, > MIPI_DIGITAL_PLL_16, > @@ -477,7 +477,7 @@ static int anx7625_set_k_value(struct anx7625_data *ctx) > > static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > unsigned long m, n; > u16 htotal; > int ret; > @@ -575,7 +575,7 @@ static int anx7625_dsi_video_timing_config(struct > anx7625_data *ctx) > static int anx7625_swap_dsi_lane3(struct anx7625_data *ctx) > { > int val; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Swap MIPI-DSI data lane 3 P and N */ > val = anx7625_reg_read(ctx, ctx->i2c.rx_p1_client, MIPI_SWAP); > @@ -592,7 +592,7 @@ static int anx7625_api_dsi_config(struct anx7625_data > *ctx) > > { > int val, ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Swap MIPI-DSI data lane 3 P and N */ > ret = anx7625_swap_dsi_lane3(ctx); > @@ -657,7 +657,7 @@ static int anx7625_api_dsi_config(struct anx7625_data > *ctx) > > static int anx7625_dsi_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int ret; > > DRM_DEV_DEBUG_DRIVER(dev, "config dsi.\n"); > @@ -689,7 +689,7 @@ static int anx7625_dsi_config(struct anx7625_data *ctx) > > static int anx7625_api_dpi_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > u16 freq = ctx->dt.pixelclock.min / 1000; > int ret; > > @@ -720,7 +720,7 @@ static int anx7625_api_dpi_config(struct anx7625_data > *ctx) > > static int anx7625_dpi_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int ret; > > DRM_DEV_DEBUG_DRIVER(dev, "config dpi\n"); > @@ -765,7 +765,7 @@ static int anx7625_read_flash_status(struct anx7625_data > *ctx) > static int anx7625_hdcp_key_probe(struct anx7625_data *ctx) > { > int ret, val; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > u8 ident[FLASH_BUF_LEN]; > > ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > @@ -815,7 +815,7 @@ static int anx7625_hdcp_key_probe(struct anx7625_data > *ctx) > static int anx7625_hdcp_key_load(struct anx7625_data *ctx) > { > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Select HDCP 1.4 KEY */ > ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > @@ -843,7 +843,7 @@ static int anx7625_hdcp_key_load(struct anx7625_data *ctx) > static int anx7625_hdcp_disable(struct anx7625_data *ctx) > { > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > dev_dbg(dev, "disable HDCP 1.4\n"); > > @@ -864,7 +864,7 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx) > { > u8
Re: [PATCH v12 06/10] drm/bridge: Remove redundant i2c_client in anx7625/it6505
On Tue, Feb 21, 2023 at 05:50:50PM +0800, Pin-yen Lin wrote: > These two drivers embed a i2c_client in there private driver data, but > only strict device is actually needed. Replace the i2c_client reference > with a struct device one. LGTM, Reviewed-by: Andy Shevchenko > Signed-off-by: Pin-yen Lin > --- > > Changes in v12: > - New in v12 > > drivers/gpu/drm/bridge/analogix/anx7625.c | 96 > drivers/gpu/drm/bridge/analogix/anx7625.h | 2 +- > drivers/gpu/drm/bridge/ite-it6505.c | 128 +++--- > 3 files changed, 113 insertions(+), 113 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c > b/drivers/gpu/drm/bridge/analogix/anx7625.c > index 486b5099f5dd..cd628a2e2e50 100644 > --- a/drivers/gpu/drm/bridge/analogix/anx7625.c > +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c > @@ -207,7 +207,7 @@ static int anx7625_read_ctrl_status_p0(struct > anx7625_data *ctx) > > static int wait_aux_op_finish(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int val; > int ret; > > @@ -234,7 +234,7 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) > static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address, >u8 len, u8 *buf) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int ret; > u8 addrh, addrm, addrl; > u8 cmd; > @@ -427,7 +427,7 @@ static int anx7625_odfc_config(struct anx7625_data *ctx, > u8 post_divider) > { > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Config input reference clock frequency 27MHz/19.2MHz */ > ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_16, > @@ -477,7 +477,7 @@ static int anx7625_set_k_value(struct anx7625_data *ctx) > > static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > unsigned long m, n; > u16 htotal; > int ret; > @@ -575,7 +575,7 @@ static int anx7625_dsi_video_timing_config(struct > anx7625_data *ctx) > static int anx7625_swap_dsi_lane3(struct anx7625_data *ctx) > { > int val; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Swap MIPI-DSI data lane 3 P and N */ > val = anx7625_reg_read(ctx, ctx->i2c.rx_p1_client, MIPI_SWAP); > @@ -592,7 +592,7 @@ static int anx7625_api_dsi_config(struct anx7625_data > *ctx) > > { > int val, ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Swap MIPI-DSI data lane 3 P and N */ > ret = anx7625_swap_dsi_lane3(ctx); > @@ -657,7 +657,7 @@ static int anx7625_api_dsi_config(struct anx7625_data > *ctx) > > static int anx7625_dsi_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int ret; > > DRM_DEV_DEBUG_DRIVER(dev, "config dsi.\n"); > @@ -689,7 +689,7 @@ static int anx7625_dsi_config(struct anx7625_data *ctx) > > static int anx7625_api_dpi_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > u16 freq = ctx->dt.pixelclock.min / 1000; > int ret; > > @@ -720,7 +720,7 @@ static int anx7625_api_dpi_config(struct anx7625_data > *ctx) > > static int anx7625_dpi_config(struct anx7625_data *ctx) > { > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > int ret; > > DRM_DEV_DEBUG_DRIVER(dev, "config dpi\n"); > @@ -765,7 +765,7 @@ static int anx7625_read_flash_status(struct anx7625_data > *ctx) > static int anx7625_hdcp_key_probe(struct anx7625_data *ctx) > { > int ret, val; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > u8 ident[FLASH_BUF_LEN]; > > ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > @@ -815,7 +815,7 @@ static int anx7625_hdcp_key_probe(struct anx7625_data > *ctx) > static int anx7625_hdcp_key_load(struct anx7625_data *ctx) > { > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > /* Select HDCP 1.4 KEY */ > ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, > @@ -843,7 +843,7 @@ static int anx7625_hdcp_key_load(struct anx7625_data *ctx) > static int anx7625_hdcp_disable(struct anx7625_data *ctx) > { > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > dev_dbg(dev, "disable HDCP 1.4\n"); > > @@ -864,7 +864,7 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx) > { > u8 bcap; > int ret; > - struct device *dev = >client->dev; > + struct device *dev = ctx->dev; > > ret =
[PATCH v12 06/10] drm/bridge: Remove redundant i2c_client in anx7625/it6505
These two drivers embed a i2c_client in there private driver data, but only strict device is actually needed. Replace the i2c_client reference with a struct device one. Signed-off-by: Pin-yen Lin --- Changes in v12: - New in v12 drivers/gpu/drm/bridge/analogix/anx7625.c | 96 drivers/gpu/drm/bridge/analogix/anx7625.h | 2 +- drivers/gpu/drm/bridge/ite-it6505.c | 128 +++--- 3 files changed, 113 insertions(+), 113 deletions(-) diff --git a/drivers/gpu/drm/bridge/analogix/anx7625.c b/drivers/gpu/drm/bridge/analogix/anx7625.c index 486b5099f5dd..cd628a2e2e50 100644 --- a/drivers/gpu/drm/bridge/analogix/anx7625.c +++ b/drivers/gpu/drm/bridge/analogix/anx7625.c @@ -207,7 +207,7 @@ static int anx7625_read_ctrl_status_p0(struct anx7625_data *ctx) static int wait_aux_op_finish(struct anx7625_data *ctx) { - struct device *dev = >client->dev; + struct device *dev = ctx->dev; int val; int ret; @@ -234,7 +234,7 @@ static int wait_aux_op_finish(struct anx7625_data *ctx) static int anx7625_aux_trans(struct anx7625_data *ctx, u8 op, u32 address, u8 len, u8 *buf) { - struct device *dev = >client->dev; + struct device *dev = ctx->dev; int ret; u8 addrh, addrm, addrl; u8 cmd; @@ -427,7 +427,7 @@ static int anx7625_odfc_config(struct anx7625_data *ctx, u8 post_divider) { int ret; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; /* Config input reference clock frequency 27MHz/19.2MHz */ ret = anx7625_write_and(ctx, ctx->i2c.rx_p1_client, MIPI_DIGITAL_PLL_16, @@ -477,7 +477,7 @@ static int anx7625_set_k_value(struct anx7625_data *ctx) static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) { - struct device *dev = >client->dev; + struct device *dev = ctx->dev; unsigned long m, n; u16 htotal; int ret; @@ -575,7 +575,7 @@ static int anx7625_dsi_video_timing_config(struct anx7625_data *ctx) static int anx7625_swap_dsi_lane3(struct anx7625_data *ctx) { int val; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; /* Swap MIPI-DSI data lane 3 P and N */ val = anx7625_reg_read(ctx, ctx->i2c.rx_p1_client, MIPI_SWAP); @@ -592,7 +592,7 @@ static int anx7625_api_dsi_config(struct anx7625_data *ctx) { int val, ret; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; /* Swap MIPI-DSI data lane 3 P and N */ ret = anx7625_swap_dsi_lane3(ctx); @@ -657,7 +657,7 @@ static int anx7625_api_dsi_config(struct anx7625_data *ctx) static int anx7625_dsi_config(struct anx7625_data *ctx) { - struct device *dev = >client->dev; + struct device *dev = ctx->dev; int ret; DRM_DEV_DEBUG_DRIVER(dev, "config dsi.\n"); @@ -689,7 +689,7 @@ static int anx7625_dsi_config(struct anx7625_data *ctx) static int anx7625_api_dpi_config(struct anx7625_data *ctx) { - struct device *dev = >client->dev; + struct device *dev = ctx->dev; u16 freq = ctx->dt.pixelclock.min / 1000; int ret; @@ -720,7 +720,7 @@ static int anx7625_api_dpi_config(struct anx7625_data *ctx) static int anx7625_dpi_config(struct anx7625_data *ctx) { - struct device *dev = >client->dev; + struct device *dev = ctx->dev; int ret; DRM_DEV_DEBUG_DRIVER(dev, "config dpi\n"); @@ -765,7 +765,7 @@ static int anx7625_read_flash_status(struct anx7625_data *ctx) static int anx7625_hdcp_key_probe(struct anx7625_data *ctx) { int ret, val; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; u8 ident[FLASH_BUF_LEN]; ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, @@ -815,7 +815,7 @@ static int anx7625_hdcp_key_probe(struct anx7625_data *ctx) static int anx7625_hdcp_key_load(struct anx7625_data *ctx) { int ret; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; /* Select HDCP 1.4 KEY */ ret = anx7625_reg_write(ctx, ctx->i2c.rx_p0_client, @@ -843,7 +843,7 @@ static int anx7625_hdcp_key_load(struct anx7625_data *ctx) static int anx7625_hdcp_disable(struct anx7625_data *ctx) { int ret; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; dev_dbg(dev, "disable HDCP 1.4\n"); @@ -864,7 +864,7 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx) { u8 bcap; int ret; - struct device *dev = >client->dev; + struct device *dev = ctx->dev; ret = anx7625_hdcp_key_probe(ctx); if (ret) { @@ -922,7 +922,7 @@ static int anx7625_hdcp_enable(struct anx7625_data *ctx) static void anx7625_dp_start(struct anx7625_data *ctx) { int ret; - struct device *dev = >client->dev; + struct device *dev