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:34 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-09-10 06:12:28 -0400
commit0a25a5aee727c4a56c7d39e0e595947b02ee2696 (patch)
tree61262c46f4547de8b87c4a91df5e195f7fe4e76c /drivers/block/cciss.c
parentee86273062cbb310665fe49e1f1937d2cf85b0b9 (diff)
cciss: factor out cciss_getpciinfo
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.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 31064df1370a..4fe5e427c480 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1230,9 +1230,22 @@ static void check_ioctl_unit_attention(ctlr_info_t *h, CommandList_struct *c)
1230 c->err_info->ScsiStatus != SAM_STAT_CHECK_CONDITION) 1230 c->err_info->ScsiStatus != SAM_STAT_CHECK_CONDITION)
1231 (void)check_for_unit_attention(h, c); 1231 (void)check_for_unit_attention(h, c);
1232} 1232}
1233/* 1233
1234 * ioctl 1234static int cciss_getpciinfo(ctlr_info_t *h, void __user *argp)
1235 */ 1235{
1236 cciss_pci_info_struct pciinfo;
1237
1238 if (!argp)
1239 return -EINVAL;
1240 pciinfo.domain = pci_domain_nr(h->pdev->bus);
1241 pciinfo.bus = h->pdev->bus->number;
1242 pciinfo.dev_fn = h->pdev->devfn;
1243 pciinfo.board_id = h->board_id;
1244 if (copy_to_user(argp, &pciinfo, sizeof(cciss_pci_info_struct)))
1245 return -EFAULT;
1246 return 0;
1247}
1248
1236static int cciss_ioctl(struct block_device *bdev, fmode_t mode, 1249static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1237 unsigned int cmd, unsigned long arg) 1250 unsigned int cmd, unsigned long arg)
1238{ 1251{
@@ -1245,20 +1258,7 @@ static int cciss_ioctl(struct block_device *bdev, fmode_t mode,
1245 cmd, arg); 1258 cmd, arg);
1246 switch (cmd) { 1259 switch (cmd) {
1247 case CCISS_GETPCIINFO: 1260 case CCISS_GETPCIINFO:
1248 { 1261 return cciss_getpciinfo(h, argp);
1249 cciss_pci_info_struct pciinfo;
1250
1251 if (!arg)
1252 return -EINVAL;
1253 pciinfo.domain = pci_domain_nr(h->pdev->bus);
1254 pciinfo.bus = h->pdev->bus->number;
1255 pciinfo.dev_fn = h->pdev->devfn;
1256 pciinfo.board_id = h->board_id;
1257 if (copy_to_user
1258 (argp, &pciinfo, sizeof(cciss_pci_info_struct)))
1259 return -EFAULT;
1260 return 0;
1261 }
1262 case CCISS_GETINTINFO: 1262 case CCISS_GETINTINFO:
1263 { 1263 {
1264 cciss_coalint_struct intinfo; 1264 cciss_coalint_struct intinfo;