From: Baruch Siach <baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 3/5] spi: dw: add support for gpio controlled chip select
Date: Tue, 28 Jan 2014 14:35:06 +0200 [thread overview]
Message-ID: <20140128123506.GY5596@tarshish> (raw)
In-Reply-To: <20140127185754.GK11841-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
Hi Mark,
On Mon, Jan 27, 2014 at 06:57:54PM +0000, Mark Brown wrote:
> > + if (gpio_is_valid(spi->cs_gpio)) {
> > + ret = devm_gpio_request(&spi->dev, spi->cs_gpio,
> > + dev_name(&spi->dev));
> > + if (ret)
> > + return ret;
> > + ret = gpio_direction_output(spi->cs_gpio,
> > + !(spi->mode & SPI_CS_HIGH));
> > + if (ret)
> > + return ret;
> > + }
>
> Should be devm_gpio_request_one(). This won't work with probe deferral,
> it's outside the probe() function so nothing will retry.
So how about doing devm_gpio_request_one() in probe() right after
devm_spi_register_master()? This should be compatible with deferral, and yet
avoid open coding the "cs-gpios" property parsing as the pl022 driver does.
baruch
--
http://baruch.siach.name/blog/ ~. .~ Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
- baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org - tel: +972.2.679.5364, http://www.tkos.co.il -
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-01-28 12:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-26 8:14 [PATCH v2 0/5] spi: dw: device tree and generic queue support Baruch Siach
[not found] ` <cover.1390723880.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-26 8:14 ` [PATCH v2 1/5] spi: dw-mmio: allow multiple instances Baruch Siach
[not found] ` <0c3d4438111a3024bce6ebf113b92ccead963e81.1390723880.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-27 19:02 ` Mark Brown
2014-01-26 8:14 ` [PATCH v2 2/5] spi: dw-mmio: add device tree support Baruch Siach
[not found] ` <4898c1f4dc88caa2b19fd04a57b7d20b53494644.1390723880.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-27 18:50 ` Mark Brown
[not found] ` <20140127185004.GJ11841-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-27 18:54 ` Baruch Siach
2014-01-27 19:02 ` Mark Brown
2014-01-26 8:14 ` [PATCH v2 3/5] spi: dw: add support for gpio controlled chip select Baruch Siach
[not found] ` <b9ce1224f836ec84d5c75636b6838039a7664c89.1390723880.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-27 18:57 ` Mark Brown
[not found] ` <20140127185754.GK11841-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-28 12:35 ` Baruch Siach [this message]
2014-01-28 15:42 ` Mark Brown
[not found] ` <20140128154212.GN11841-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-28 18:11 ` Baruch Siach
2014-01-28 18:16 ` Mark Brown
2014-01-26 8:14 ` [PATCH v2 4/5] spi: dw: document device tree binding Baruch Siach
[not found] ` <211f8d2101fff1790526f7dff766d0d9efff9280.1390723880.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-27 19:08 ` Mark Brown
[not found] ` <20140127190839.GN11841-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-27 19:18 ` Baruch Siach
2014-01-27 19:22 ` Mark Brown
[not found] ` <20140127192251.GP11841-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-01-28 4:53 ` Baruch Siach
2014-01-26 8:14 ` [PATCH v2 5/5] spi: dw: migrate to generic queue infrastructure Baruch Siach
[not found] ` <53b986fa2a26aade601e64aa3063029cdc33feb8.1390723880.git.baruch-NswTu9S1W3P6gbPvEgmw2w@public.gmane.org>
2014-01-27 19:13 ` Mark Brown
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=20140128123506.GY5596@tarshish \
--to=baruch-nswtu9s1w3p6gbpvegmw2w@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).