Skip to content

Commit a7bdb9a

Browse files
Uwe Kleine-Königgregkh
authored andcommitted
s390/cio: Make struct css_driver::remove return void
The driver core ignores the return value of css_remove() (because there is only little it can do when a device disappears) and all callbacks return 0 anyhow. So make it impossible for future drivers to return an unused error code by changing the remove prototype to return void. The real motivation for this change is the quest to make struct bus_type::remove return void, too. Reviewed-by: Cornelia Huck <[email protected]> Acked-by: Vineeth Vijayan <[email protected]> Signed-off-by: Uwe Kleine-König <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent dde0a31 commit a7bdb9a

File tree

6 files changed

+10
-14
lines changed

6 files changed

+10
-14
lines changed

drivers/s390/cio/chsc_sch.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static int chsc_subchannel_probe(struct subchannel *sch)
100100
return ret;
101101
}
102102

103-
static int chsc_subchannel_remove(struct subchannel *sch)
103+
static void chsc_subchannel_remove(struct subchannel *sch)
104104
{
105105
struct chsc_private *private;
106106

@@ -112,7 +112,6 @@ static int chsc_subchannel_remove(struct subchannel *sch)
112112
put_device(&sch->dev);
113113
}
114114
kfree(private);
115-
return 0;
116115
}
117116

118117
static void chsc_subchannel_shutdown(struct subchannel *sch)

drivers/s390/cio/css.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,12 +1374,13 @@ static int css_probe(struct device *dev)
13741374
static int css_remove(struct device *dev)
13751375
{
13761376
struct subchannel *sch;
1377-
int ret;
13781377

13791378
sch = to_subchannel(dev);
1380-
ret = sch->driver->remove ? sch->driver->remove(sch) : 0;
1379+
if (sch->driver->remove)
1380+
sch->driver->remove(sch);
13811381
sch->driver = NULL;
1382-
return ret;
1382+
1383+
return 0;
13831384
}
13841385

13851386
static void css_shutdown(struct device *dev)

drivers/s390/cio/css.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct css_driver {
8181
int (*chp_event)(struct subchannel *, struct chp_link *, int);
8282
int (*sch_event)(struct subchannel *, int);
8383
int (*probe)(struct subchannel *);
84-
int (*remove)(struct subchannel *);
84+
void (*remove)(struct subchannel *);
8585
void (*shutdown)(struct subchannel *);
8686
int (*settle)(void);
8787
};

drivers/s390/cio/device.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ static int ccw_uevent(struct device *dev, struct kobj_uevent_env *env)
137137

138138
static void io_subchannel_irq(struct subchannel *);
139139
static int io_subchannel_probe(struct subchannel *);
140-
static int io_subchannel_remove(struct subchannel *);
140+
static void io_subchannel_remove(struct subchannel *);
141141
static void io_subchannel_shutdown(struct subchannel *);
142142
static int io_subchannel_sch_event(struct subchannel *, int);
143143
static int io_subchannel_chp_event(struct subchannel *, struct chp_link *,
@@ -1101,7 +1101,7 @@ static int io_subchannel_probe(struct subchannel *sch)
11011101
return 0;
11021102
}
11031103

1104-
static int io_subchannel_remove(struct subchannel *sch)
1104+
static void io_subchannel_remove(struct subchannel *sch)
11051105
{
11061106
struct io_subchannel_private *io_priv = to_io_private(sch);
11071107
struct ccw_device *cdev;
@@ -1120,7 +1120,6 @@ static int io_subchannel_remove(struct subchannel *sch)
11201120
io_priv->dma_area, io_priv->dma_area_dma);
11211121
kfree(io_priv);
11221122
sysfs_remove_group(&sch->dev.kobj, &io_subchannel_attr_group);
1123-
return 0;
11241123
}
11251124

11261125
static void io_subchannel_verify(struct subchannel *sch)

drivers/s390/cio/eadm_sch.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static void eadm_quiesce(struct subchannel *sch)
282282
spin_unlock_irq(sch->lock);
283283
}
284284

285-
static int eadm_subchannel_remove(struct subchannel *sch)
285+
static void eadm_subchannel_remove(struct subchannel *sch)
286286
{
287287
struct eadm_private *private = get_eadm_private(sch);
288288

@@ -297,8 +297,6 @@ static int eadm_subchannel_remove(struct subchannel *sch)
297297
spin_unlock_irq(sch->lock);
298298

299299
kfree(private);
300-
301-
return 0;
302300
}
303301

304302
static void eadm_subchannel_shutdown(struct subchannel *sch)

drivers/s390/cio/vfio_ccw_drv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
234234
return ret;
235235
}
236236

237-
static int vfio_ccw_sch_remove(struct subchannel *sch)
237+
static void vfio_ccw_sch_remove(struct subchannel *sch)
238238
{
239239
struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
240240
struct vfio_ccw_crw *crw, *temp;
@@ -257,7 +257,6 @@ static int vfio_ccw_sch_remove(struct subchannel *sch)
257257
VFIO_CCW_MSG_EVENT(4, "unbound from subchannel %x.%x.%04x\n",
258258
sch->schid.cssid, sch->schid.ssid,
259259
sch->schid.sch_no);
260-
return 0;
261260
}
262261

263262
static void vfio_ccw_sch_shutdown(struct subchannel *sch)

0 commit comments

Comments
 (0)