mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Christoph Hellwig <hch@lst.de>,
	Chandra Seetharaman <sekharan@us.ibm.com>,
	Hannes Reinecke <hare@suse.de>
Cc: Sean Stewart <Sean.Stewart@netapp.com>,
	Bart Van Assche <bvanassche@acm.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] scsi: handle more device handler setup/teardown in common code
Date: Tue, 28 Oct 2014 12:53:00 -0500	[thread overview]
Message-ID: <544FD7FC.8070005@cs.wisc.edu> (raw)
In-Reply-To: <1413734404-1426-7-git-send-email-hch@lst.de>

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?

  parent reply	other threads:[~2014-10-28 17:53 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-19 15:59 device handler cleanups Christoph Hellwig
2014-10-19 15:59 ` [PATCH 1/6] scsi_dh: get module reference outside of device handler Christoph Hellwig
2014-10-20  6:01   ` Hannes Reinecke
2014-10-20  6:53     ` Christoph Hellwig
2014-10-20  8:06       ` Hannes Reinecke
2014-10-19 16:00 ` [PATCH 2/6] scsi: use container_of to get at device handler private data Christoph Hellwig
2014-10-20  6:02   ` Hannes Reinecke
2014-10-19 16:00 ` [PATCH 3/6] scsi: remove struct scsi_dh_devlist Christoph Hellwig
2014-10-20  6:03   ` Hannes Reinecke
2014-10-19 16:00 ` [PATCH 4/6] scsi: device handlers must have attach and detach methods Christoph Hellwig
2014-10-20  6:04   ` Hannes Reinecke
2014-10-19 16:00 ` [PATCH 5/6] scsi_dh_hp_sw: fix return value on failed allocation Christoph Hellwig
2014-10-20  6:04   ` Hannes Reinecke
2014-10-19 16:00 ` [PATCH 6/6] scsi: handle more device handler setup/teardown in common code Christoph Hellwig
2014-10-20  6:06   ` Hannes Reinecke
2014-10-28 17:53   ` Mike Christie [this message]
2014-10-30  9:00     ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=544FD7FC.8070005@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=Sean.Stewart@netapp.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sekharan@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome