From: Wolfram Sang <wsa@the-dreams.de>
To: Michal Simek <monstr@monstr.eu>
Cc: Soren Brinkmann <soren.brinkmann@xilinx.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Kumar Gala <galak@codeaurora.org>, Rob Landley <rob@landley.net>,
Russell King <linux@arm.linux.org.uk>,
Michal Simek <michal.simek@xilinx.com>,
Grant Likely <grant.likely@linaro.org>,
Mike Looijmans <mike.looijmans@topic.nl>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org,
devicetree@vger.kernel.org, linux-i2c@vger.kernel.org,
Harini Katakam <harinik@xilinx.com>
Subject: Re: [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>
[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]
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.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
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>
next prev parent reply other threads:[~2014-04-03 7:10 UTC|newest]
Thread overview: 30+ 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 ` Soren Brinkmann
2014-03-11 16:50 ` 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-11 16:50 ` Soren Brinkmann
2014-03-20 11:35 ` Michal Simek
2014-03-20 11:35 ` Michal Simek
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-19 22:03 ` Sören Brinkmann
2014-03-19 22:03 ` Sören Brinkmann
[not found] ` <1394556613-11692-1-git-send-email-soren.brinkmann-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org>
2014-03-20 11:34 ` Michal Simek
2014-03-20 11:34 ` Michal Simek
2014-03-20 11:34 ` Michal Simek
2014-04-01 0:50 ` Wolfram Sang
2014-04-01 0:50 ` Wolfram Sang
2014-04-01 0:50 ` Wolfram Sang
2014-04-01 21:24 ` Sören Brinkmann
2014-04-01 21:24 ` Sören Brinkmann
2014-04-01 21:24 ` Sören Brinkmann
2014-04-03 6:00 ` Michal Simek
2014-04-03 6:00 ` Michal Simek
2014-04-03 7:10 ` Wolfram Sang [this message]
2014-04-03 7:10 ` Wolfram Sang
2014-04-03 7:25 ` Michal Simek
2014-04-03 7:25 ` Michal Simek
2014-04-03 7:25 ` Michal Simek
2014-04-03 15:42 ` Sören Brinkmann
2014-04-03 15:42 ` Sören Brinkmann
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=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=harinik@xilinx.com \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=michal.simek@xilinx.com \
--cc=mike.looijmans@topic.nl \
--cc=monstr@monstr.eu \
--cc=pawel.moll@arm.com \
--cc=rob@landley.net \
--cc=robh+dt@kernel.org \
--cc=soren.brinkmann@xilinx.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 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.