[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YWU5v8aH3wtsAMlp@ninjato>
Date: Tue, 12 Oct 2021 09:31:11 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Enric Balletbo i Serra <enric.balletbo@...labora.com>,
linux-kernel@...r.kernel.org, linux-renesas-soc@...r.kernel.org,
Lars-Peter Clausen <lars@...afoo.de>,
Benson Leung <bleung@...omium.org>,
Guenter Roeck <groeck@...omium.org>, linux-iio@...r.kernel.org
Subject: Re: [PATCH 6/9] iio: common: cros_ec_sensors: simplify getting
.driver_data
Hi Jonathan,
> It's not something that ever bothered me that much, but we have had debates in
> the past about whether there are semantic issues around this sort of cleanup
> as it mixes
>
> platform_set_drvdata() with device_get_drvdata()
Yeah, I see this concern. Mixing the two makes reading the code a bit
more difficult. As I said, it wasn't so easy to convert set_drvdata, but
I will have another go at this.
> Whilst they access the same pointer today, in theory that isn't necessarily
> always going to be the case in future and it isn't necessarily apparent
> to the casual reader of the code.
That one I don't really see. *_get_drvdata() should always get
'dev->driver_data' and the prefix just tells from what namespace we
come. If you want to change that, a lot of things will break loose, I'd
think. Even in the unlikely case of platform_device gaining a seperate
driver_data(?), it probably should be named *_get_pdrvdata(), or?
Thanks and happy hacking,
Wolfram
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists