aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorStephen M. Cameron <scameron@beardog.cce.hp.com>2010-08-26 14:56:10 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:12:34 -0400
commit8a4f7fbfdd76a304c8f04dde6b8fd0e5c50bbe76 (patch)
treebecfda4a679543971f2cdbc948d47cb960bf80c0 /drivers
parentd18dfad4e2bf6c2d2c5c104d882b14b9fee71b14 (diff)
cciss: factor out cciss_getfirmver
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/cciss.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index e7b650b7f548..c47e601f601c 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1357,6 +1357,20 @@ static int cciss_getbustypes(ctlr_info_t *h, void __user *argp)
1357 return 0; 1357 return 0;
1358} 1358}
1359 1359
1360static int cciss_getfirmver(ctlr_info_t *h, void __user *argp)
1361{
1362 FirmwareVer_type firmware;
1363
1364 if (!argp)
1365 return -EINVAL;
1366 memcpy(firmware, h->firm_ver, 4);
1367
1368 if (copy_to_user
1369 (argp, firmware, sizeof(FirmwareVer_type)))
1370 return -EFAULT;
1371 return 0;
1372}
1373
1360static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1374static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1361 unsigned int cmd, unsigned long arg) 1375 unsigned int cmd, unsigned long arg)
1362{ 1376{
@@ -1383,18 +1397,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1383 case CCISS_GETBUSTYPES: 1397 case CCISS_GETBUSTYPES:
1384 return cciss_getbustypes(h, argp); 1398 return cciss_getbustypes(h, argp);
1385 case CCISS_GETFIRMVER: 1399 case CCISS_GETFIRMVER:
1386 { 1400 return cciss_getfirmver(h, argp);
1387 FirmwareVer_type firmware;
1388
1389 if (!arg)
1390 return -EINVAL;
1391 memcpy(firmware, h->firm_ver, 4);
1392
1393 if (copy_to_user
1394 (argp, firmware, sizeof(FirmwareVer_type)))
1395 return -EFAULT;
1396 return 0;
1397 }
1398 case CCISS_GETDRIVVER: 1401 case CCISS_GETDRIVVER:
1399 { 1402 {
1400 DriverVer_type DriverVer = DRIVER_VERSION; 1403 DriverVer_type DriverVer = DRIVER_VERSION;