linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c: only check scl functions when using generic recovery
@ 2016-05-12  9:25 Wolfram Sang
  2016-05-13 10:40 ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Wolfram Sang @ 2016-05-12  9:25 UTC (permalink / raw)
  To: linux-i2c; +Cc: Wolfram Sang, Peter Griffin

A custom recovery function doesn't need these pointers to be populated
because it may work differently internally.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Tested-by: Peter Griffin <peter.griffin@linaro.org>
---
 drivers/i2c/i2c-core.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index 9da44616252995..af11b658984d76 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1594,10 +1594,12 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
 
 			bri->get_scl = get_scl_gpio_value;
 			bri->set_scl = set_scl_gpio_value;
-		} else if (!bri->set_scl || !bri->get_scl) {
+		} else if (bri->recover_bus == i2c_generic_scl_recovery) {
 			/* Generic SCL recovery */
-			dev_err(&adap->dev, "No {get|set}_gpio() found, not using recovery\n");
-			adap->bus_recovery_info = NULL;
+			if (!bri->set_scl || !bri->get_scl) {
+				dev_err(&adap->dev, "No {get|set}_scl() found, not using recovery\n");
+				adap->bus_recovery_info = NULL;
+			}
 		}
 	}
 
-- 
2.8.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] i2c: only check scl functions when using generic recovery
  2016-05-12  9:25 [PATCH] i2c: only check scl functions when using generic recovery Wolfram Sang
@ 2016-05-13 10:40 ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2016-05-13 10:40 UTC (permalink / raw)
  To: linux-i2c; +Cc: Peter Griffin

[-- Attachment #1: Type: text/plain, Size: 328 bytes --]

On Thu, May 12, 2016 at 11:25:19AM +0200, Wolfram Sang wrote:
> A custom recovery function doesn't need these pointers to be populated
> because it may work differently internally.
> 
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> Tested-by: Peter Griffin <peter.griffin@linaro.org>

Applied to for-next, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-13 10:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12  9:25 [PATCH] i2c: only check scl functions when using generic recovery Wolfram Sang
2016-05-13 10:40 ` Wolfram Sang

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).