Skip to content

Commit c9add2e

Browse files
committed
zorro: make match function take a const pointer
In commit d69d804 ("driver core: have match() callback in struct bus_type take a const *"), the match callback for busses was changed to take a const pointer to struct device_driver. Unfortunately I missed fixing up the zorro code, and was only noticed after-the-fact by the kernel test robot. Resolve this issue by properly changing the zorro_bus_match() function. Cc: Geert Uytterhoeven <[email protected]> Fixes: d69d804 ("driver core: have match() callback in struct bus_type take a const *") Reported-by: kernel test robot <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Acked-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 67c1ba5 commit c9add2e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

drivers/zorro/zorro-driver.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ EXPORT_SYMBOL(zorro_unregister_driver);
118118
* supported, and 0 if there is no match.
119119
*/
120120

121-
static int zorro_bus_match(struct device *dev, struct device_driver *drv)
121+
static int zorro_bus_match(struct device *dev, const struct device_driver *drv)
122122
{
123123
struct zorro_dev *z = to_zorro_dev(dev);
124-
struct zorro_driver *zorro_drv = to_zorro_driver(drv);
124+
const struct zorro_driver *zorro_drv = to_zorro_driver(drv);
125125
const struct zorro_device_id *ids = zorro_drv->id_table;
126126

127127
if (!ids)

include/linux/zorro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ struct zorro_driver {
5252
struct device_driver driver;
5353
};
5454

55-
#define to_zorro_driver(drv) container_of(drv, struct zorro_driver, driver)
55+
#define to_zorro_driver(drv) container_of_const(drv, struct zorro_driver, driver)
5656

5757

5858
#define zorro_for_each_dev(dev) \

0 commit comments

Comments
 (0)