Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: sa1100: make match function take a const pointer

In commit d69d80484598 ("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 sa1111 code, and was only noticed after-the-fact by the
kernel test robot. Resolve this issue by properly changing the
sa111_match() function.

Cc: Russell King <linux@armlinux.org.uk>
Fixes: d69d80484598 ("driver core: have match() callback in struct bus_type take a const *")
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20240712093916.2121096-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+3 -3
+2 -2
arch/arm/common/sa1111.c
··· 1339 1339 * We model this as a regular bus type, and hang devices directly 1340 1340 * off this. 1341 1341 */ 1342 - static int sa1111_match(struct device *_dev, struct device_driver *_drv) 1342 + static int sa1111_match(struct device *_dev, const struct device_driver *_drv) 1343 1343 { 1344 1344 struct sa1111_dev *dev = to_sa1111_device(_dev); 1345 - struct sa1111_driver *drv = SA1111_DRV(_drv); 1345 + const struct sa1111_driver *drv = SA1111_DRV(_drv); 1346 1346 1347 1347 return !!(dev->devid & drv->devid); 1348 1348 }
+1 -1
arch/arm/include/asm/hardware/sa1111.h
··· 404 404 void (*remove)(struct sa1111_dev *); 405 405 }; 406 406 407 - #define SA1111_DRV(_d) container_of((_d), struct sa1111_driver, drv) 407 + #define SA1111_DRV(_d) container_of_const((_d), struct sa1111_driver, drv) 408 408 409 409 #define SA1111_DRIVER_NAME(_sadev) ((_sadev)->dev.driver->name) 410 410