From cb74f6676656297a05a7ac55c12586fa49345a3d Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Fri, 3 Sep 2021 04:59:06 +0000 Subject: [PATCH] scst_local: Port to Linux kernel v5.15 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9503 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst_local/scst_local.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 34d9727e8..0eda086a2 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1653,7 +1653,14 @@ out: return ret; } -static int scst_local_driver_remove(struct device *dev) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) +/* See also commit fc7a6209d571 ("bus: Make remove callback return void") */ +#define DRIVER_REMOVE_RET int +#else +#define DRIVER_REMOVE_RET void +#endif + +static DRIVER_REMOVE_RET scst_local_driver_remove(struct device *dev) { struct scst_local_sess *sess; struct Scsi_Host *shost = NULL; @@ -1670,7 +1677,7 @@ static int scst_local_driver_remove(struct device *dev) scsi_host_put(shost); TRACE_EXIT(); - return 0; + return (DRIVER_REMOVE_RET)0; } static int scst_local_bus_match(struct device *dev,