On Fri, Aug 23, 2024 at 02:42:03PM +0800, Kunwu Chan wrote:Sure, i've find the patch series (https://lore.kernel.org/all/20240528102708.1451343-2-andy.shevchenko@xxxxxxxxx/)
From: Kunwu Chan <chentao@xxxxxxxxxx>...
Since commit d492cc2573a0 ("driver core: device.h: make struct
bus_type a const *"), the driver core can properly handle constant
struct bus_type, move the amba_bustype variable to be a constant
structure as well, placing it into read-only memory which can not be
modified at runtime.
-extern struct bus_type amba_bustype;Can we actually hide this from the outside, i.e. make it static in the C file,
+extern const struct bus_type amba_bustype;
and introduce the dev_is_amba() helper instead?
P.S. You may look at the PNP bus case (some of the latest patches there).I'll change it as PNP bus in v2.