linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: w.sang@pengutronix.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: mx5/mx53_evk: Remove unneeded gpio_set_value call
Date: Sun, 20 Mar 2011 20:24:52 +0100	[thread overview]
Message-ID: <20110320192451.GA19808@pengutronix.de> (raw)
In-Reply-To: <Pine.LNX.4.64.1103201850250.27008@ask.diku.dk>

Hi Julia,

> What is the degree of interest in having gpio_request_one be used?  Right 
> now, it is very little used.  But there seem to be over 900 places where 
> it could be used.

I have a very high interest in getting it more known/used.

> One advantage of gpio_request_one is that it manages error handling.  

Yes, that's what I like about it; checks for two errors in one call
(especially the latter one is often forgotten in current code).

> However a number of current calls to gpio_request and 
> gpio_direction_input/output don't save or test the return value.  Are 
> there cases where these operations cannot fail?

It is a mixture of pragmatism and lazyness. For board setup code, mostly
CPU-internal GPIOs are used and one can assume that they are always there
because they are often set up in the same file. I wouldn't mind the error
checks to catch the 0.00001% chance of it failing for whatever reason (most
probably a careless update); still, the error checks have to be added by hand,
because you need to know something about the board to handle the error
correctly (igonre it? stop booting?).

For device drivers, the checks really should be made because one cannot assume
anything about the GPIOs passed by platform data. The problem here is that you
cannot use gpio_request_one yet because it is not available yet with !GPIOLIB.
I have sent a patch [1] to fix it, but Grant needs some more time to review. If
he accepts it, I wanted to clean up the drivers as a first step (with
coccinelle surely involved ;)).

Regards,

   Wolfram

[1] <1297530239-7429-1-git-send-email-w.sang@pengutronix.de>

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20110320/dc5e6c2e/attachment.sig>

  reply	other threads:[~2011-03-20 19:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14 18:21 [PATCH 1/2] ARM: mx5/babbage: Remove unneeded gpio_set_value call Fabio Estevam
2011-03-14 18:21 ` [PATCH 2/2] ARM: mx5/mx53_evk: " Fabio Estevam
2011-03-15  9:06   ` Uwe Kleine-König
2011-03-15  9:41     ` Julia Lawall
2011-03-15  9:49       ` Uwe Kleine-König
2011-03-15 10:19         ` Julia Lawall
2011-03-15 10:29           ` Wolfram Sang
2011-03-16  8:33           ` Uwe Kleine-König
2011-03-16  9:15             ` Julia Lawall
2011-03-16 14:19             ` Fabio Estevam
2011-03-20 17:56             ` Julia Lawall
2011-03-20 19:24               ` Wolfram Sang [this message]
2011-03-20 20:51                 ` Julia Lawall
2011-03-20 21:30                   ` Wolfram Sang
2011-03-20 21:42                     ` Julia Lawall
2011-03-20 21:04                 ` Julia Lawall
2011-03-21  7:43                   ` Grant Likely
2011-03-21  7:59                     ` Julia Lawall
2011-03-21  7:48           ` Grant Likely
2011-03-21  8:01             ` Julia Lawall

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=20110320192451.GA19808@pengutronix.de \
    --to=w.sang@pengutronix.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).