Re: [PATCH] rtc: tx4939: Kill get_tx4939rtc_plat_data() function

From: Atsushi Nemoto
Date: Wed Dec 19 2012 - 08:52:18 EST


On Wed, 19 Dec 2012 17:29:04 +0800, Axel Lin <axel.lin@xxxxxxxxxx> wrote:
> Simply use dev_get_drvdata() instead.
>
> Signed-off-by: Axel Lin <axel.lin@xxxxxxxxxx>
> ---
> drivers/rtc/rtc-tx4939.c | 21 ++++++++-------------
> 1 file changed, 8 insertions(+), 13 deletions(-)

Hi Axel,

Thank you for cleanup, but, a platform driver should use
platform_get_drvdata / platform_set_drvdata, no?

I think using dev_get_drvdata() in platform_get_drvdata() is an
implementation detail of the platform device framework, so we should
not depends on such an internal detail.

If there was any reason to use dev_get_drvdata, please convert all
platform_get_drvdata and platform_set_drvdata to dev_get_drvdata and
dev_set_drvdata. We should avoid mixing two APIs.

---
Atsushi Nemoto
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/