All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <James.Bottomley@SteelEye.com>,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/4] aic7xxx: Add suspend/resume support
Date: Fri, 19 Oct 2007 09:44:07 +0100	[thread overview]
Message-ID: <20071019084407.GA23211@infradead.org> (raw)
In-Reply-To: <20071019083222.11DAE18C61E@pentland.suse.de>

I think this needs a little restructuring. ahd_pci_suspend/ahd_pci_resume
should be merged into their callers and use the normal Linux pci accessors,
and ahd_suspend/ahd_resume are tiny enough to merged into the caller aswell.

> +#ifdef CONFIG_PM
> +	.suspend	= ahd_linux_pci_dev_suspend,
> +	.resume		= ahd_linux_pci_dev_resume,
> +#endif
>  	.remove		= ahd_linux_pci_dev_remove,
>  	.id_table	= ahd_linux_pci_id_table
>  };
>  
> +static int
> +ahd_linux_pci_dev_suspend(struct pci_dev *pdev, pm_message_t mesg)

I think this needsa #ifdef CONFIG_PM aswell.  Also any chance you
could implement functions before their use so we can avoid forward
declarations.

> +{
> +	struct ahd_softc *ahd = pci_get_drvdata(pdev);
> +	int rc;
> +
> +	if ((rc = ahd_suspend(ahd)))
> +		return rc;

	rc = ahd_suspend(ahd)
	if (rc)
		return rc;

but as I mentioned above better just inline the content of ahd_suspend
into this function. That would also catch that ahd_suspend returns
positive errno values and we'd have to invert them here.

Same comments apply to the aic7xxx portion.

  reply	other threads:[~2007-10-19  8:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-19  8:32 [PATCH 1/4] aic7xxx: Add suspend/resume support Hannes Reinecke
2007-10-19  8:44 ` Christoph Hellwig [this message]
2007-10-19 12:35   ` Hannes Reinecke
2007-10-19 13:02     ` Christoph Hellwig
2007-10-19 13:45       ` Hannes Reinecke

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=20071019084407.GA23211@infradead.org \
    --to=hch@infradead.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.