Message ID | 20250117-clarify-probe-after-bind-v1-2-273f046ce5dd@linaro.org |
---|---|
State | New |
Headers | show |
Series | Clarify DM_FLAG_PROBE_AFTER_BIND behaviour | expand |
On Fri, 17 Jan 2025 at 00:29, Caleb Connolly <caleb.connolly@linaro.org> wrote: > > Some drivers set DM_FLAG_PROBE_AFTER_BIND, this does nothing since it's > only every applied on a per-device basis. > > Remove the flags. > > Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> > --- > drivers/mailbox/zynqmp-ipi.c | 1 - > drivers/watchdog/da9063-wdt.c | 1 - > 2 files changed, 2 deletions(-) > > diff --git a/drivers/mailbox/zynqmp-ipi.c b/drivers/mailbox/zynqmp-ipi.c > index 713d93a200c4..851aa737c03e 100644 > --- a/drivers/mailbox/zynqmp-ipi.c > +++ b/drivers/mailbox/zynqmp-ipi.c > @@ -269,6 +269,5 @@ U_BOOT_DRIVER(zynqmp_ipi) = { > .name = "zynqmp_ipi", > .id = UCLASS_NOP, > .of_match = zynqmp_ipi_ids, > .probe = zynqmp_ipi_probe, > - .flags = DM_FLAG_PROBE_AFTER_BIND, > }; > diff --git a/drivers/watchdog/da9063-wdt.c b/drivers/watchdog/da9063-wdt.c > index b7216b578630..ec9bc0330114 100644 > --- a/drivers/watchdog/da9063-wdt.c > +++ b/drivers/watchdog/da9063-wdt.c > @@ -144,6 +144,5 @@ U_BOOT_DRIVER(da9063_wdt) = { > .name = "da9063-wdt", > .id = UCLASS_WDT, > .of_match = da9063_wdt_ids, > .ops = &da9063_wdt_ops, > - .flags = DM_FLAG_PROBE_AFTER_BIND, > }; > > -- > 2.48.0 > Reviewed-by: Simon Glass <sjg@chromium.org> It is actually a bit unclear, since the comments for struct driver mention DM_FLAG_... for the flags.
On 18/01/2025 05:32, Simon Glass wrote: > On Fri, 17 Jan 2025 at 00:29, Caleb Connolly <caleb.connolly@linaro.org > <mailto:caleb.connolly@linaro.org>> wrote: >> >> Some drivers set DM_FLAG_PROBE_AFTER_BIND, this does nothing since it's >> only every applied on a per-device basis. >> >> Remove the flags. >> >> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org > <mailto:caleb.connolly@linaro.org>> >> --- >> drivers/mailbox/zynqmp-ipi.c | 1 - >> drivers/watchdog/da9063-wdt.c | 1 - >> 2 files changed, 2 deletions(-) >> >> diff --git a/drivers/mailbox/zynqmp-ipi.c b/drivers/mailbox/zynqmp-ipi.c >> index 713d93a200c4..851aa737c03e 100644 >> --- a/drivers/mailbox/zynqmp-ipi.c >> +++ b/drivers/mailbox/zynqmp-ipi.c >> @@ -269,6 +269,5 @@ U_BOOT_DRIVER(zynqmp_ipi) = { >> .name = "zynqmp_ipi", >> .id = UCLASS_NOP, >> .of_match = zynqmp_ipi_ids, >> .probe = zynqmp_ipi_probe, >> - .flags = DM_FLAG_PROBE_AFTER_BIND, >> }; >> diff --git a/drivers/watchdog/da9063-wdt.c b/drivers/watchdog/da9063-wdt.c >> index b7216b578630..ec9bc0330114 100644 >> --- a/drivers/watchdog/da9063-wdt.c >> +++ b/drivers/watchdog/da9063-wdt.c >> @@ -144,6 +144,5 @@ U_BOOT_DRIVER(da9063_wdt) = { >> .name = "da9063-wdt", >> .id = UCLASS_WDT, >> .of_match = da9063_wdt_ids, >> .ops = &da9063_wdt_ops, >> - .flags = DM_FLAG_PROBE_AFTER_BIND, >> }; >> >> -- >> 2.48.0 >> > > Reviewed-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>> > > It is actually a bit unclear, since the comments for struct driver > mention DM_FLAG_... for the flags. Yep, some of the flags (most even?) can be applied to drivers and there is no proper distinction between which apply to drivers and which to devices. DRIVER_FLAG_... and DEV_FLAG_... or something maybe better, something to revisit in the future for sure. Thx for the review
Hi Caleb, On Tue, 21 Jan 2025 at 05:00, Caleb Connolly <caleb.connolly@linaro.org> wrote: > > > > On 18/01/2025 05:32, Simon Glass wrote: > > On Fri, 17 Jan 2025 at 00:29, Caleb Connolly <caleb.connolly@linaro.org > > <mailto:caleb.connolly@linaro.org>> wrote: > >> > >> Some drivers set DM_FLAG_PROBE_AFTER_BIND, this does nothing since it's > >> only every applied on a per-device basis. > >> > >> Remove the flags. > >> > >> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org > > <mailto:caleb.connolly@linaro.org>> > >> --- > >> drivers/mailbox/zynqmp-ipi.c | 1 - > >> drivers/watchdog/da9063-wdt.c | 1 - > >> 2 files changed, 2 deletions(-) > >> > >> diff --git a/drivers/mailbox/zynqmp-ipi.c b/drivers/mailbox/zynqmp-ipi.c > >> index 713d93a200c4..851aa737c03e 100644 > >> --- a/drivers/mailbox/zynqmp-ipi.c > >> +++ b/drivers/mailbox/zynqmp-ipi.c > >> @@ -269,6 +269,5 @@ U_BOOT_DRIVER(zynqmp_ipi) = { > >> .name = "zynqmp_ipi", > >> .id = UCLASS_NOP, > >> .of_match = zynqmp_ipi_ids, > >> .probe = zynqmp_ipi_probe, > >> - .flags = DM_FLAG_PROBE_AFTER_BIND, > >> }; > >> diff --git a/drivers/watchdog/da9063-wdt.c b/drivers/watchdog/da9063-wdt.c > >> index b7216b578630..ec9bc0330114 100644 > >> --- a/drivers/watchdog/da9063-wdt.c > >> +++ b/drivers/watchdog/da9063-wdt.c > >> @@ -144,6 +144,5 @@ U_BOOT_DRIVER(da9063_wdt) = { > >> .name = "da9063-wdt", > >> .id = UCLASS_WDT, > >> .of_match = da9063_wdt_ids, > >> .ops = &da9063_wdt_ops, > >> - .flags = DM_FLAG_PROBE_AFTER_BIND, > >> }; > >> > >> -- > >> 2.48.0 > >> > > > > Reviewed-by: Simon Glass <sjg@chromium.org <mailto:sjg@chromium.org>> > > > > It is actually a bit unclear, since the comments for struct driver > > mention DM_FLAG_... for the flags. > > Yep, some of the flags (most even?) can be applied to drivers and there > is no proper distinction between which apply to drivers and which to > devices. I would rather have one set of flags if we can. There are flags which only affect binding so perhaps they should be at the start of the enum, with flags which only affect the device after that. But the original reason for not setting a flag like DM_FLAG_PROBE_AFTER_BIND in the driver was that the driver wanted to control whether to set it in the device. > > DRIVER_FLAG_... and DEV_FLAG_... or something maybe better, something to > revisit in the future for sure. > > Thx for the review Regards, SImon
diff --git a/drivers/mailbox/zynqmp-ipi.c b/drivers/mailbox/zynqmp-ipi.c index 713d93a200c4..851aa737c03e 100644 --- a/drivers/mailbox/zynqmp-ipi.c +++ b/drivers/mailbox/zynqmp-ipi.c @@ -269,6 +269,5 @@ U_BOOT_DRIVER(zynqmp_ipi) = { .name = "zynqmp_ipi", .id = UCLASS_NOP, .of_match = zynqmp_ipi_ids, .probe = zynqmp_ipi_probe, - .flags = DM_FLAG_PROBE_AFTER_BIND, }; diff --git a/drivers/watchdog/da9063-wdt.c b/drivers/watchdog/da9063-wdt.c index b7216b578630..ec9bc0330114 100644 --- a/drivers/watchdog/da9063-wdt.c +++ b/drivers/watchdog/da9063-wdt.c @@ -144,6 +144,5 @@ U_BOOT_DRIVER(da9063_wdt) = { .name = "da9063-wdt", .id = UCLASS_WDT, .of_match = da9063_wdt_ids, .ops = &da9063_wdt_ops, - .flags = DM_FLAG_PROBE_AFTER_BIND, };
Some drivers set DM_FLAG_PROBE_AFTER_BIND, this does nothing since it's only every applied on a per-device basis. Remove the flags. Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org> --- drivers/mailbox/zynqmp-ipi.c | 1 - drivers/watchdog/da9063-wdt.c | 1 - 2 files changed, 2 deletions(-)