regulator: add 88PM8607 PMIC driver
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 1252320709.5876.25.camel@odin
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 2/3 regulator: add 88PM8607 PMIC driver
Forwarded to correct mailing list manually, pity.
Quoted 72 lines · Eric Miao
Quoted 52 lines · Haojian Zhuang
Quoted 33 lines · Samuel Ortiz
Quoted 16 lines · Mark Brown
Review
Quoted 10 lines · Haojian Zhuang
(quoted diff) +10
-0+static int __remove_subdev(struct device *dev, void *unused) +{ + ? platform_device_unregister(to_platform_device(dev)); + ? return 0; +} + +static int pm8607_remove_subdevs(struct pm8607_chip *chip) +{ + ? return device_for_each_child(chip->dev, NULL, __remove_subdev); +}You could just use the MFD core functions for this - they implement the same actions.
Quoted 15 lines
Review
Quoted 10 lines
+static int
__devinitpm8607_add_subdevs(structpm8607_chip*chip,
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? structpm8607_platform_data*pdata)(quoted diff) +7
-0+{ + ? struct pm8607_subdev_info *subdev; + ? struct platform_device *pdev; + ? int i, ret = 0; + + ? for (i = 0; i < pdata->num_subdevs; i++) { + ? ? ? ? ? subdev = &pdata->subdevs[i];I think I queried last time you posted the driver why it's doing this - I'd have expected that the driver would know most if not all of the subdevices which are present without needing the information to be supplied by platform data.
Quoted 8 lines
I agree. Please give us an explanation here. All other MFD drivers are declaring their subdevices from the driver code, not by fetching data from the
platform specific declarations.Cheers,
Samuel.Hi Mark & Samuel,
Yes, MFD core driver can take this job also. But it addes more initialization code in custom MFD driver.
I formated the patch again for MFD core driver. Let's review that we have to assign all kinds of resources and subdevs in the MFD driver. Even I'm not planning use it in the platform driver.
Quoted 7 lines
If I'm using my original patch, I needn't do such the initialization. I just assign the ones in platform driver and initlize the subdevs in custom MFD driver.
From this view, I think that custom MFD driver is complex and not very clear.
I'd agree with this.
I don't see any point that the use of the MFD API is mandatory here. This is really a simple and straightforward task to add all the sub-devices (as
platform_device- though I don't like thisplatform_deviceat all), and maybe in a specific manner the composite device needs, we don't really need to involve all thosemfd_cell, and resource copying stuffs.- eric
PATCH 2/3 regulator: add 88PM8607 PMIC driver
Quoted 12 lines · Eric Miao
Forwarded to correct mailing list manually, pity.
Quoted 10 lines
Quoted 2 lines
Yes, MFD core driver can take this job also. But it addes more initialization code in custom MFD driver.
I'd agree with this.
I don't see any point that the use of the MFD API is mandatory here. This is really a simple and straightforward task to add all the sub-devices (as
platform_device- though I don't like thisplatform_deviceat all), and maybe in a specific manner the composite device needs, we don't really need to involve all thosemfd_cell, and resource copying stuffs.
The point I was making wasn't so much about using the MFD API itself as about the fact that I'd expect the bit of the device driver that sits under drivers/mfd to know about all the subdevices that needed registering, especially for things which don't usually need any system specific configuration. I'd probably not have said anything if the original code hadn't taken the entire list of subdevices in as platform data.