diff options
author | Stephen M. Cameron <scameron@beardog.cce.hp.com> | 2010-08-26 14:56:05 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-09-10 06:12:33 -0400 |
commit | d18dfad4e2bf6c2d2c5c104d882b14b9fee71b14 (patch) | |
tree | a7ccc43dbe19dba9b5d14ac08871813c62470c59 /drivers/block/cciss.c | |
parent | 93c74931131d3a7af3a6aa18aab0d39978b5d3b5 (diff) |
cciss: factor out cciss_getbustypes
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.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index e716fc9e4b3e..e7b650b7f548 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1345,6 +1345,18 @@ static int cciss_getheartbeat(ctlr_info_t *h, void __user *argp) | |||
1345 | return 0; | 1345 | return 0; |
1346 | } | 1346 | } |
1347 | 1347 | ||
1348 | static int cciss_getbustypes(ctlr_info_t *h, void __user *argp) | ||
1349 | { | ||
1350 | BusTypes_type BusTypes; | ||
1351 | |||
1352 | if (!argp) | ||
1353 | return -EINVAL; | ||
1354 | BusTypes = readl(&h->cfgtable->BusTypes); | ||
1355 | if (copy_to_user(argp, &BusTypes, sizeof(BusTypes_type))) | ||
1356 | return -EFAULT; | ||
1357 | return 0; | ||
1358 | } | ||
1359 | |||
1348 | static int cciss_ioctl(struct block_device *bdev, fmode_t mode, | 1360 | static int cciss_ioctl(struct block_device *bdev, fmode_t mode, |
1349 | unsigned int cmd, unsigned long arg) | 1361 | unsigned int cmd, unsigned long arg) |
1350 | { | 1362 | { |
@@ -1369,17 +1381,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode, | |||
1369 | case CCISS_GETHEARTBEAT: | 1381 | case CCISS_GETHEARTBEAT: |
1370 | return cciss_getheartbeat(h, argp); | 1382 | return cciss_getheartbeat(h, argp); |
1371 | case CCISS_GETBUSTYPES: | 1383 | case CCISS_GETBUSTYPES: |
1372 | { | 1384 | return cciss_getbustypes(h, argp); |
1373 | BusTypes_type BusTypes; | ||
1374 | |||
1375 | if (!arg) | ||
1376 | return -EINVAL; | ||
1377 | BusTypes = readl(&h->cfgtable->BusTypes); | ||
1378 | if (copy_to_user | ||
1379 | (argp, &BusTypes, sizeof(BusTypes_type))) | ||
1380 | return -EFAULT; | ||
1381 | return 0; | ||
1382 | } | ||
1383 | case CCISS_GETFIRMVER: | 1385 | case CCISS_GETFIRMVER: |
1384 | { | 1386 | { |
1385 | FirmwareVer_type firmware; | 1387 | FirmwareVer_type firmware; |