Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1240246

Re: [RFC] pwm: chip_data vs device_data

From Olliver Schinagl <oliver+list@schinagl.nl>
Newsgroups linux.kernel
Subject Re: [RFC] pwm: chip_data vs device_data
Date 2015-10-06 10:30 +0200
Message-ID <qgvNg-Gu-19@gated-at.bofh.it> (permalink)
References <qguRc-7Jr-13@gated-at.bofh.it> <qgv0T-7Vp-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hey Thierry,

thans for your quick reply :)

On 06-10-15 09:38, Thierry Reding wrote:
> On Tue, Oct 06, 2015 at 09:20:53AM +0200, Olliver Schinagl wrote:
>> Hey Thierry, list,
>>
>> While working on something in the pwm framework, I noticed that the void
>> *data in the pwm_device struct is called chip_data. Why is it not called
>> device_data, since it is the data associated with a PWM device, rather then
>> the chip, and on that note, if it really is chip related data (thus covering
>> the whole chip, not just the single pwm device) why is there no chip_data in
>> pwm_chip?
> The reason for the name is that it's chip-specific data associated with
> a struct pwm_device. That is, a PWM chip implementation (i.e. driver)
> can use it to keep per-PWM data that's not in struct pwm_device itself.
Then I have to wrap my head around what is a chip and what is a device :)

To me, it seems that a chip can hold X number of pwm devices, and each 
pwm_device has a unique set of properties, duty, plarity, period. So it 
seems that some device specific data could go here as well, where i'm 
bad at examples now
>
>> Again, is this something worth my time to add a device_data and rename
>> chip_data?
> device_data would be redundant because it's already part of struct
> pwm_device. Plain data might be okay, but I like the chip_ prefix
> because it marks the data as being chip-specific data rather than
> generic.
well here i'd imagine the chip specific data (not allready in the struct).

I'll be subimtting my RFC work later this week after a little bit more 
work and will bring this up again :)

Olliver
>
> Thierry

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC] pwm: chip_data vs device_data Olliver Schinagl <oliver+list@schinagl.nl> - 2015-10-06 09:30 +0200
  Re: [RFC] pwm: chip_data vs device_data Thierry Reding <thierry.reding@gmail.com> - 2015-10-06 09:40 +0200
    Re: [RFC] pwm: chip_data vs device_data Olliver Schinagl <oliver+list@schinagl.nl> - 2015-10-06 10:30 +0200
      Re: [RFC] pwm: chip_data vs device_data Thierry Reding <thierry.reding@gmail.com> - 2015-10-06 11:20 +0200

csiph-web