Re: [PATCH RESEND v6 1/5] mfd: axp20x: Constify axp313 and axp717 cells
Jerome Brunet <[email protected]>
| Newsgroups | dev.linux.lists.sashiko-reviews,dev.linux.lists.mfd,org.kernel.vger.linux-devicetree |
|---|---|
| Message-ID | <[email protected]> |
On sam. 12 janv. 2008 at 23:37, [email protected] wrote: > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: > > Pre-existing issues: > - [Medium] Hard-coded cell IDs are used in `axp806_cells` and > `axp809_cells` instead of leveraging `platform_device->id` or > `PLATFORM_DEVID_AUTO`, violating MFD subsystem guidelines. > -- > > --- Patch [1]: [PATCH RESEND v6 1/5] mfd: axp20x: Constify axp313 and axp717 cells --- > commit d0271b0bfb6609a5dbfc9c713361a49994e56202 > Author: Jerome Brunet <[email protected]> > > mfd: axp20x: Constify axp313 and axp717 cells > > This commit constifies the mfd_cells arrays for the axp313 and axp717 chips. > It aligns their declarations with the rest of the supported chips where > the arrays are properly marked as const. As expected and already explained in the cover-letter. > >> diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c >> index 679364189ea58..22baab6e10fa6 100644 >> --- a/drivers/mfd/axp20x.c >> +++ b/drivers/mfd/axp20x.c > > [ ... ] > >> static const struct mfd_cell axp806_cells[] = { >> { >> .id = 2, >> .name = "axp20x-regulator", >> }, >> }; >> >> static const struct mfd_cell axp809_cells[] = { >> { >> .name = "axp20x-gpio", >> .of_compatible = "x-powers,axp221-gpio", >> }, { >> .name = "axp221-pek", >> .num_resources = ARRAY_SIZE(axp809_pek_resources), >> .resources = axp809_pek_resources, >> }, { >> .id = 1, >> .name = "axp20x-regulator", >> }, >> }; > > [Severity: Medium] > This is a pre-existing issue, but is it safe to use hard-coded cell IDs > like 1 and 2 for the axp20x-regulator cells in the axp806_cells and > axp809_cells arrays? > > The MFD subsystem guidelines require using PLATFORM_DEVID_AUTO for automatic > cell indexing, or platform_device->id if numbering is explicitly needed. > > Can this hard-coded cell ID usage lead to device naming collisions in sysfs > or driver load failures? -- Jerome