linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/2] i2c: Add driver for Cadence I2C controller
Date: Thu, 3 Apr 2014 09:10:04 +0200	[thread overview]
Message-ID: <20140403071004.GA2571@katana> (raw)
In-Reply-To: <533CF913.4020308@monstr.eu>


Please don't quote large parts of the message f you are not referring to
it.

> > +#ifdef CONFIG_PM_SLEEP
> > +/**
> > + * cdns_i2c_suspend - Suspend method for the driver
> > + * @_dev:	Address of the platform_device structure
> > + * Return: 0 always
> > + *
> > + * Put the driver into low power mode.
> > + */
> > +static int cdns_i2c_suspend(struct device *_dev)
> > +{
> > +	struct platform_device *pdev = container_of(_dev,
> > +			struct platform_device, dev);
> > +	struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
> > +
> > +	clk_disable(xi2c->clk);
> > +	xi2c->suspended = 1;
> > +
> > +	return 0;
> > +}
> > +
> > +/**
> > + * cdns_i2c_resume - Resume from suspend
> > + * @_dev:	Address of the platform_device structure
> > + * Return: 0 on success and error value on error
> > + *
> > + * Resume operation after suspend.
> > + */
> > +static int cdns_i2c_resume(struct device *_dev)
> > +{
> > +	struct platform_device *pdev = container_of(_dev,
> > +			struct platform_device, dev);
> > +	struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
> > +	int ret;
> > +
> > +	ret = clk_enable(xi2c->clk);
> > +	if (ret) {
> > +		dev_err(_dev, "Cannot enable clock.\n");
> > +		return ret;
> > +	}
> > +
> > +	xi2c->suspended = 0;
> > +
> > +	return 0;
> > +}
> > +#endif
> 
> Can you also please remove this #ifdef and use __maybe_used
> instead? Better not to have any ifdef in the code.

Is this a new pattern? For PM_SLEEP, #ifdef seems to be quite common.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20140403/1da2955a/attachment.sig>

  reply	other threads:[~2014-04-03  7:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11 16:50 [PATCH v3 1/2] i2c: Add driver for Cadence I2C controller Soren Brinkmann
2014-03-11 16:50 ` [PATCH v3 2/2] ARM: zynq: dt: Add I2C nodes to Zynq device tree Soren Brinkmann
2014-03-20 11:35   ` Michal Simek
2014-03-19 22:03 ` [PATCH v3 1/2] i2c: Add driver for Cadence I2C controller Sören Brinkmann
2014-03-20 11:34 ` Michal Simek
2014-04-01  0:50 ` Wolfram Sang
2014-04-01 21:24   ` Sören Brinkmann
2014-04-03  6:00 ` Michal Simek
2014-04-03  7:10   ` Wolfram Sang [this message]
2014-04-03  7:25     ` Michal Simek
2014-04-03 15:42       ` Sören Brinkmann

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=20140403071004.GA2571@katana \
    --to=wsa@the-dreams.de \
    --cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).