Skip to content

Commit 5b8e8ee

Browse files
Geert UytterhoevenLinus Torvalds
authored andcommitted
[PATCH] ps3: add shutdown to virtual uart port driver framework
PS3: Add a shutdown method to the PS3's virtual uart port driver framework Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5e14ab8 commit 5b8e8ee

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎drivers/ps3/vuart.c‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,22 @@ static int ps3_vuart_remove(struct device *_dev)
867867
return 0;
868868
}
869869

870+
static void ps3_vuart_shutdown(struct device *_dev)
871+
{
872+
struct ps3_vuart_port_device *dev = to_ps3_vuart_port_device(_dev);
873+
struct ps3_vuart_port_driver *drv =
874+
to_ps3_vuart_port_driver(_dev->driver);
875+
876+
dev_dbg(&dev->core, "%s:%d: %s\n", __func__, __LINE__,
877+
dev->core.bus_id);
878+
879+
if (drv->shutdown)
880+
drv->shutdown(dev);
881+
else
882+
dev_dbg(&dev->core, "%s:%d: %s no shutdown method\n", __func__,
883+
__LINE__, dev->core.bus_id);
884+
}
885+
870886
/**
871887
* ps3_vuart - The vuart instance.
872888
*
@@ -878,6 +894,7 @@ struct bus_type ps3_vuart = {
878894
.match = ps3_vuart_match,
879895
.probe = ps3_vuart_probe,
880896
.remove = ps3_vuart_remove,
897+
.shutdown = ps3_vuart_shutdown,
881898
};
882899

883900
int __init ps3_vuart_init(void)

‎drivers/ps3/vuart.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ struct ps3_vuart_port_driver {
3030
struct device_driver core;
3131
int (*probe)(struct ps3_vuart_port_device *);
3232
int (*remove)(struct ps3_vuart_port_device *);
33+
void (*shutdown)(struct ps3_vuart_port_device *);
3334
int (*tx_event)(struct ps3_vuart_port_device *dev);
3435
int (*rx_event)(struct ps3_vuart_port_device *dev);
3536
int (*disconnect_event)(struct ps3_vuart_port_device *dev);

0 commit comments

Comments
 (0)