aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/cciss.c
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-08-26 14:55:59 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:12:32 -0400
commit93c74931131d3a7af3a6aa18aab0d39978b5d3b5 (patch)
tree81f9811e6cc2f8d3072f4fbe90a242f0e4d7d5ed /drivers/block/cciss.c
parent4f43f32cd3f65cfee5f30d7e6be55854cf33809b (diff)
cciss: factor out cciss_getheartbeat
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r--drivers/block/cciss.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 8bbb1c81bf86..e716fc9e4b3e 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1333,6 +1333,18 @@ static int cciss_setnodename(ctlr_info_t *h, void __user *argp)
1333 return 0; 1333 return 0;
1334} 1334}
1335 1335
1336static int cciss_getheartbeat(ctlr_info_t *h, void __user *argp)
1337{
1338 Heartbeat_type heartbeat;
1339
1340 if (!argp)
1341 return -EINVAL;
1342 heartbeat = readl(&h->cfgtable->HeartBeat);
1343 if (copy_to_user(argp, &heartbeat, sizeof(Heartbeat_type)))
1344 return -EFAULT;
1345 return 0;
1346}
1347
1336static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1348static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1337 unsigned int cmd, unsigned long arg) 1349 unsigned int cmd, unsigned long arg)
1338{ 1350{
@@ -1355,17 +1367,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1355 case CCISS_SETNODENAME: 1367 case CCISS_SETNODENAME:
1356 return cciss_setnodename(h, argp); 1368 return cciss_setnodename(h, argp);
1357 case CCISS_GETHEARTBEAT: 1369 case CCISS_GETHEARTBEAT:
1358 { 1370 return cciss_getheartbeat(h, argp);
1359 Heartbeat_type heartbeat;
1360
1361 if (!arg)
1362 return -EINVAL;
1363 heartbeat = readl(&h->cfgtable->HeartBeat);
1364 if (copy_to_user
1365 (argp, &heartbeat, sizeof(Heartbeat_type)))
1366 return -EFAULT;
1367 return 0;
1368 }
1369 case CCISS_GETBUSTYPES: 1371 case CCISS_GETBUSTYPES:
1370 { 1372 {
1371 BusTypes_type BusTypes; 1373 BusTypes_type BusTypes;