Skip to content

Commit

Permalink
dio: Have dio_bus_match() callback take a const *
Browse files Browse the repository at this point in the history
drivers/dio/dio-driver.c:128:11: error: initialization of ‘int (*)(struct device *, const struct device_driver *)’ from incompatible pointer type ‘int (*)(struct device *, struct device_driver *)’ [-Werror=incompatible-pointer-types]
  128 |  .match = dio_bus_match,
      |           ^~~~~~~~~~~~~
drivers/dio/dio-driver.c:128:11: note: (near initialization for ‘dio_bus_type.match’)

Reported-by: [email protected]
Fixes: d69d804 ("driver core: have match() callback in struct bus_type take a const *")
Signed-off-by: Geert Uytterhoeven <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[ added dio.h change - gregkh ]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
geertu authored and gregkh committed Jul 10, 2024
1 parent c9add2e commit af46fe8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/dio/dio-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ void dio_unregister_driver(struct dio_driver *drv)
* and 0 if there is no match.
*/

static int dio_bus_match(struct device *dev, struct device_driver *drv)
static int dio_bus_match(struct device *dev, const struct device_driver *drv)
{
struct dio_dev *d = to_dio_dev(dev);
struct dio_driver *dio_drv = to_dio_driver(drv);
const struct dio_driver *dio_drv = to_dio_driver(drv);
const struct dio_device_id *ids = dio_drv->id_table;

if (!ids)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/dio.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct dio_driver {
struct device_driver driver;
};

#define to_dio_driver(drv) container_of(drv, struct dio_driver, driver)
#define to_dio_driver(drv) container_of_const(drv, struct dio_driver, driver)

/* DIO/DIO-II boards all have the following 8bit registers.
* These are offsets from the base of the device.
Expand Down

0 comments on commit af46fe8

Please sign in to comment.