From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jingoo Han" Subject: Re: [RFC PATCH v4 6/8] drm/bridge/analogix: Do not use device's drvdata Date: Tue, 17 Oct 2017 19:43:56 -0400 Message-ID: <000101d347a1$cd216160$67642420$@gmail.com> References: <20171017101624.12506-1-jeffy.chen@rock-chips.com> <20171017101624.12506-7-jeffy.chen@rock-chips.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20171017101624.12506-7-jeffy.chen@rock-chips.com> Content-language: en-us Sender: linux-kernel-owner@vger.kernel.org To: 'Jeffy Chen' , linux-kernel@vger.kernel.org Cc: dmitry.torokhov@gmail.com, heiko@sntech.de, briannorris@chromium.org, rjw@rjwysocki.net, dianders@chromium.org, tfiga@chromium.org, broonie@kernel.org, seanpaul@chromium.org, 'Andrzej Hajda' , dri-devel@lists.freedesktop.org, 'Caesar Wang' , 'David Airlie' , 'Laurent Pinchart' , linux-samsung-soc@vger.kernel.org, 'Seung-Woo Kim' , 'Inki Dae' , linux-rockchip@lists.infradead.org, 'Kyungmin Park' , 'Krzysztof Kozlowski' , 'Kukjin Kim' , 'Tomeu Vizoso' , 'Vincent Abriou' List-Id: linux-rockchip.vger.kernel.org On Tuesday, October 17, 2017 6:16 AM, Jeffy Chen wrote: > > From: Tomasz Figa > > The driver that instantiates the bridge should own the drvdata, as all > driver model callbacks (probe, remove, shutdown, PM ops, etc.) are also > owned by its driver struct. Moreover, storing two different pointer > types in driver data depending on driver initialization status is barely > a good practice and in fact has led to many bugs in this driver. > > Let's clean up this mess and change Analogix entry points to simply > accept some opaque struct pointer, adjusting their users at the same > time to avoid breaking the compilation. > > Signed-off-by: Tomasz Figa > Signed-off-by: Jeffy Chen > Reviewed-by: Andrzej Hajda Acked-by: Jingoo Han Best regards, Jingoo Han > --- > > Changes in v4: None > Changes in v3: None > Changes in v2: None > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 50 +++++++++-------- > ----- > drivers/gpu/drm/exynos/exynos_dp.c | 26 ++++++----- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 47 +++++++++++------- > -- > include/drm/bridge/analogix_dp.h | 19 ++++---- > 4 files changed, 73 insertions(+), 69 deletions(-) > From mboxrd@z Thu Jan 1 00:00:00 1970 From: jingoohan1@gmail.com (Jingoo Han) Date: Tue, 17 Oct 2017 19:43:56 -0400 Subject: [RFC PATCH v4 6/8] drm/bridge/analogix: Do not use device's drvdata In-Reply-To: <20171017101624.12506-7-jeffy.chen@rock-chips.com> References: <20171017101624.12506-1-jeffy.chen@rock-chips.com> <20171017101624.12506-7-jeffy.chen@rock-chips.com> Message-ID: <000101d347a1$cd216160$67642420$@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tuesday, October 17, 2017 6:16 AM, Jeffy Chen wrote: > > From: Tomasz Figa > > The driver that instantiates the bridge should own the drvdata, as all > driver model callbacks (probe, remove, shutdown, PM ops, etc.) are also > owned by its driver struct. Moreover, storing two different pointer > types in driver data depending on driver initialization status is barely > a good practice and in fact has led to many bugs in this driver. > > Let's clean up this mess and change Analogix entry points to simply > accept some opaque struct pointer, adjusting their users at the same > time to avoid breaking the compilation. > > Signed-off-by: Tomasz Figa > Signed-off-by: Jeffy Chen > Reviewed-by: Andrzej Hajda Acked-by: Jingoo Han Best regards, Jingoo Han > --- > > Changes in v4: None > Changes in v3: None > Changes in v2: None > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 50 +++++++++-------- > ----- > drivers/gpu/drm/exynos/exynos_dp.c | 26 ++++++----- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 47 +++++++++++------- > -- > include/drm/bridge/analogix_dp.h | 19 ++++---- > 4 files changed, 73 insertions(+), 69 deletions(-) > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755942AbdJQXoB (ORCPT ); Tue, 17 Oct 2017 19:44:01 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:47487 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbdJQXn7 (ORCPT ); Tue, 17 Oct 2017 19:43:59 -0400 X-Google-Smtp-Source: ABhQp+SAoK7aqR0pYVHlU/mMxA3VJvPQl3vYS0OpW9TCoa4o/sciVAHgb3j4E6yb6v0JOSqX81BEkQ== From: "Jingoo Han" To: "'Jeffy Chen'" , Cc: , , , , , , , , "'Andrzej Hajda'" , , "'Caesar Wang'" , "'David Airlie'" , "'Laurent Pinchart'" , , "'Seung-Woo Kim'" , "'Inki Dae'" , , "'Kyungmin Park'" , "'Krzysztof Kozlowski'" , "'Kukjin Kim'" , "'Tomeu Vizoso'" , "'Vincent Abriou'" , "'zain wang'" , "'Archit Taneja'" , "'Joonyoung Shim'" , , "'Marek Szyprowski'" , "'Daniel Vetter'" , "'Mark Yao'" References: <20171017101624.12506-1-jeffy.chen@rock-chips.com> <20171017101624.12506-7-jeffy.chen@rock-chips.com> In-Reply-To: <20171017101624.12506-7-jeffy.chen@rock-chips.com> Subject: Re: [RFC PATCH v4 6/8] drm/bridge/analogix: Do not use device's drvdata Date: Tue, 17 Oct 2017 19:43:56 -0400 Message-ID: <000101d347a1$cd216160$67642420$@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-language: en-us Thread-Index: AQOMP7Pq2Ik12/gvw2ZcG7XxhGqa/gKdbM7In2HYiaA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, October 17, 2017 6:16 AM, Jeffy Chen wrote: > > From: Tomasz Figa > > The driver that instantiates the bridge should own the drvdata, as all > driver model callbacks (probe, remove, shutdown, PM ops, etc.) are also > owned by its driver struct. Moreover, storing two different pointer > types in driver data depending on driver initialization status is barely > a good practice and in fact has led to many bugs in this driver. > > Let's clean up this mess and change Analogix entry points to simply > accept some opaque struct pointer, adjusting their users at the same > time to avoid breaking the compilation. > > Signed-off-by: Tomasz Figa > Signed-off-by: Jeffy Chen > Reviewed-by: Andrzej Hajda Acked-by: Jingoo Han Best regards, Jingoo Han > --- > > Changes in v4: None > Changes in v3: None > Changes in v2: None > > drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 50 +++++++++-------- > ----- > drivers/gpu/drm/exynos/exynos_dp.c | 26 ++++++----- > drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 47 +++++++++++------- > -- > include/drm/bridge/analogix_dp.h | 19 ++++---- > 4 files changed, 73 insertions(+), 69 deletions(-) >