[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1454714386-15259-10-git-send-email-alexandre.bounine@idt.com>
Date: Fri, 5 Feb 2016 18:19:25 -0500
From: Alexandre Bounine <alexandre.bounine@....com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Alexandre Bounine <alexandre.bounine@....com>,
Matt Porter <mporter@...nel.crashing.org>,
Aurelien Jacquiot <a-jacquiot@...com>,
Andre van Herk <andre.van.herk@...drive-technologies.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH 09/30] rapidio: add shutdown notification for RapidIO devices
Add bus-specific callback to stop RapidIO devices during a system shutdown.
Signed-off-by: Alexandre Bounine <alexandre.bounine@....com>
Cc: Matt Porter <mporter@...nel.crashing.org>
Cc: Aurelien Jacquiot <a-jacquiot@...com>
Cc: Andre van Herk <andre.van.herk@...drive-technologies.com>
Cc: linux-kernel@...r.kernel.org
---
drivers/rapidio/rio-driver.c | 12 ++++++++++++
include/linux/rio.h | 2 ++
2 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/drivers/rapidio/rio-driver.c b/drivers/rapidio/rio-driver.c
index f301f05..128350f 100644
--- a/drivers/rapidio/rio-driver.c
+++ b/drivers/rapidio/rio-driver.c
@@ -131,6 +131,17 @@ static int rio_device_remove(struct device *dev)
return 0;
}
+static void rio_device_shutdown(struct device *dev)
+{
+ struct rio_dev *rdev = to_rio_dev(dev);
+ struct rio_driver *rdrv = rdev->driver;
+
+ dev_dbg(dev, "RIO: %s\n", __func__);
+
+ if (rdrv && rdrv->shutdown)
+ rdrv->shutdown(rdev);
+}
+
/**
* rio_register_driver - register a new RIO driver
* @rdrv: the RIO driver structure to register
@@ -229,6 +240,7 @@ struct bus_type rio_bus_type = {
.bus_groups = rio_bus_groups,
.probe = rio_device_probe,
.remove = rio_device_remove,
+ .shutdown = rio_device_shutdown,
.uevent = rio_uevent,
};
diff --git a/include/linux/rio.h b/include/linux/rio.h
index 8996a62..c64a0ba 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -423,6 +423,7 @@ struct rio_ops {
* @id_table: RIO device ids to be associated with this driver
* @probe: RIO device inserted
* @remove: RIO device removed
+ * @shutdown: shutdown notification callback
* @suspend: RIO device suspended
* @resume: RIO device awakened
* @enable_wake: RIO device enable wake event
@@ -437,6 +438,7 @@ struct rio_driver {
const struct rio_device_id *id_table;
int (*probe) (struct rio_dev * dev, const struct rio_device_id * id);
void (*remove) (struct rio_dev * dev);
+ void (*shutdown)(struct rio_dev *dev);
int (*suspend) (struct rio_dev * dev, u32 state);
int (*resume) (struct rio_dev * dev);
int (*enable_wake) (struct rio_dev * dev, u32 state, int enable);
--
1.7.8.4
Powered by blists - more mailing lists