Re: [PATCH 6/9] iio: common: cros_ec_sensors: simplify getting .driver_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 12 Oct 2021 09:31:11 +0200
Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx> wrote:

> 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?

Agreed. Does indeed seem like any change to this would be a mess so would
require different naming etc.

Thanks,

Jonathan

> 
> Thanks and happy hacking,
> 
>    Wolfram
> 
> 




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux