ALSA: ac97: fix build regression
PATCH 1/1 ALSA: ac97: fix build regression
From: Arnd Bergmann <[email protected]>
The ac97_bus_type structure is no longer declared in this file:
sound/ac97/bus.c: In function 'ac97_codec_add':sound/ac97/bus.c:112:27: error: 'ac97_bus_type' undeclared (first use in this function); did you mean 'bus_type'?
112 | codec->dev.bus = &ac97_bus_type;
| ^~~~~~~~~~~~~
| bus_typesound/ac97/bus.c:112:27: note: each undeclared identifier is reported only once for each function it appears in sound/ac97/bus.c: In function 'snd_ac97_codec_driver_register':sound/ac97/bus.c:191:28: error: 'ac97_bus_type' undeclared (first use in this function); did you mean 'ac97_bus_reset'?
191 | drv->driver.bus = &ac97_bus_type;
Include the header that contains the declaration and make sure the definition is const but not static.
--- sound/ac97/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/ac97/bus.c +2 -1
@@ -15,6 +15,7 @@#include <linux/pm_runtime.h> #include <linux/slab.h> #include <linux/sysfs.h> +#include <sound/ac97_codec.h> #include <sound/ac97/codec.h> #include <sound/ac97/controller.h> #include <sound/ac97/regs.h>
@@ -529,7 +530,7 @@ static void ac97_bus_remove(struct device *dev)pm_runtime_disable (dev); } -static struct bus_type ac97_bus_type = { +const struct bus_type ac97_bus_type = { .name ="ac97bus" , .dev_groups = ac97_dev_groups, .match = ac97_bus_match,
Signature · 1 line
2.39.2
Quoted 14 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
ac97_bus_typestructure is no longer declared in this file:
sound/ac97/bus.c: In function 'ac97_codec_add':sound/ac97/bus.c:112:27: error: 'ac97_bus_type' undeclared (first use in this function); did you mean 'bus_type'?112 | codec->dev.bus = &ac97_bus_type; | ^~~~~~~~~~~~~ | bus_type
sound/ac97/bus.c:112:27: note: each undeclared identifier is reported only once for each function it appears insound/ac97/bus.c: In function 'snd_ac97_codec_driver_register':sound/ac97/bus.c:191:28: error: 'ac97_bus_type' undeclared (first use in this function); did you mean 'ac97_bus_reset'?
191 |drv->driver.bus=&ac97_bus_type;
Quoted 8 lines
Include the header that contains the declaration and make sure the definition is const but not static.
Fixes 66e82d219924 ("ALSA: mark all struct bus_type as const")Signed-off-by Arnd Bergmann <[email protected]>--- sound/ac97/bus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Ick, sorry about that, this didn't trigger in all of my build testing, nor for 0-day, odd.
Anyway, thanks for the fix it is obviously correct:
Takashi Iwai
AppliedQuoted 15 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
The
ac97_bus_typestructure is no longer declared in this file:
sound/ac97/bus.c: In function 'ac97_codec_add':sound/ac97/bus.c:112:27: error: 'ac97_bus_type' undeclared (first use in this function); did you mean 'bus_type'?112 | codec->dev.bus = &ac97_bus_type; | ^~~~~~~~~~~~~ | bus_type
sound/ac97/bus.c:112:27: note: each undeclared identifier is reported only once for each function it appears insound/ac97/bus.c: In function 'snd_ac97_codec_driver_register':sound/ac97/bus.c:191:28: error: 'ac97_bus_type' undeclared (first use in this function); did you mean 'ac97_bus_reset'?
191 |drv->driver.bus=&ac97_bus_type;
Quoted 5 lines
Include the header that contains the declaration and make sure the definition is const but not static.
Fixes 66e82d219924 ("ALSA: mark all struct bus_type as const")Signed-off-by Arnd Bergmann <[email protected]>
Thanks, applied now.
Takashi