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:39 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:12:29 -0400
commit576e661c658ab7d2a15cc12d5b8a1600db81ec0a (patch)
tree1396cc0c1192b154f1f9e3cad80218e65e263283 /drivers/block/cciss.c
parent0a25a5aee727c4a56c7d39e0e595947b02ee2696 (diff)
cciss: factor out cciss_getintinfo
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.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 4fe5e427c480..fc761404cef7 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1246,6 +1246,20 @@ static int cciss_getpciinfo(ctlr_info_t *h, void __user *argp)
1246 return 0; 1246 return 0;
1247} 1247}
1248 1248
1249static int cciss_getintinfo(ctlr_info_t *h, void __user *argp)
1250{
1251 cciss_coalint_struct intinfo;
1252
1253 if (!argp)
1254 return -EINVAL;
1255 intinfo.delay = readl(&h->cfgtable->HostWrite.CoalIntDelay);
1256 intinfo.count = readl(&h->cfgtable->HostWrite.CoalIntCount);
1257 if (copy_to_user
1258 (argp, &intinfo, sizeof(cciss_coalint_struct)))
1259 return -EFAULT;
1260 return 0;
1261}
1262
1249static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1263static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1250 unsigned int cmd, unsigned long arg) 1264 unsigned int cmd, unsigned long arg)
1251{ 1265{
@@ -1260,19 +1274,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1260 case CCISS_GETPCIINFO: 1274 case CCISS_GETPCIINFO:
1261 return cciss_getpciinfo(h, argp); 1275 return cciss_getpciinfo(h, argp);
1262 case CCISS_GETINTINFO: 1276 case CCISS_GETINTINFO:
1263 { 1277 return cciss_getintinfo(h, argp);
1264 cciss_coalint_struct intinfo;
1265 if (!arg)
1266 return -EINVAL;
1267 intinfo.delay =
1268 readl(&h->cfgtable->HostWrite.CoalIntDelay);
1269 intinfo.count =
1270 readl(&h->cfgtable->HostWrite.CoalIntCount);
1271 if (copy_to_user
1272 (argp, &intinfo, sizeof(cciss_coalint_struct)))
1273 return -EFAULT;
1274 return 0;
1275 }
1276 case CCISS_SETINTINFO: 1278 case CCISS_SETINTINFO:
1277 { 1279 {
1278 cciss_coalint_struct intinfo; 1280 cciss_coalint_struct intinfo;