lkml.org 
[lkml]   [2014]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] scsi: handle more device handler setup/teardown in common code
On 10/19/2014 11:00 AM, Christoph Hellwig wrote:
> -static int rdac_bus_attach(struct scsi_device *sdev)
> +static struct scsi_dh_data *rdac_bus_attach(struct scsi_device *sdev)
> {
> struct rdac_dh_data *h;
> - unsigned long flags;
> int err;
> char array_name[ARRAY_LABEL_LEN];
> char array_id[UNIQUE_ID_LEN];
>
> h = kzalloc(sizeof(*h) , GFP_KERNEL);
> - if (!h) {
> - sdev_printk(KERN_ERR, sdev, "%s: Attach failed\n",
> - RDAC_NAME);
> - return -ENOMEM;
> - }
> -
> - h->dh_data.scsi_dh = &rdac_dh;
> + if (!h)
> + return ERR_PTR(-ENOMEM);
> h->lun = UNINITIALIZED_LUN;
> h->state = RDAC_STATE_ACTIVE;
>
> @@ -876,15 +856,10 @@ static int rdac_bus_attach(struct scsi_device *sdev)
> if (err != SCSI_DH_OK)
> goto clean_ctlr;
>
> - spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
> - sdev->scsi_dh_data = &h->dh_data;
> - spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
> -
> sdev_printk(KERN_NOTICE, sdev,
> "%s: LUN %d (%s) (%s)\n",
> RDAC_NAME, h->lun, mode[(int)h->mode],
> lun_state[(int)h->lun_state]);
> -
> return 0;

Was this supposed to return a "struct scsi_dh_data *" instead of zero here?


\
 
 \ /
  Last update: 2014-10-28 19:21    [W:0.104 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site