Re: [PATCH v3 1/1] i2c: taos-evm: replace simple_strtoul by kstrtou8
Hi Corentin, On Wed, 18 Nov 2015 13:55:56 +0100, LABBE Corentin wrote: > The simple_strtoul function is marked as obsolete. > This patch replace it by kstrtou8. > > Signed-off-by: LABBE Corentin Reviewed-by: Jean Delvare Tested-by: Jean Delvare Note: when there's a single patch you don't have to send an email with PATCH 0/1. > --- > drivers/i2c/busses/i2c-taos-evm.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-taos-evm.c > b/drivers/i2c/busses/i2c-taos-evm.c > index 4c7fc2d..f673f5d 100644 > --- a/drivers/i2c/busses/i2c-taos-evm.c > +++ b/drivers/i2c/busses/i2c-taos-evm.c > @@ -130,7 +130,13 @@ static int taos_smbus_xfer(struct i2c_adapter *adapter, > u16 addr, > return 0; > } else { > if (p[0] == 'x') { > - data->byte = simple_strtol(p + 1, NULL, 16); > + /* > + * voluntarily dropping error code of kstrtou8 since all > + * error code that it could return are invalid according > + * to Documentation/i2c/fault-codes > + */ > + if (kstrtou8(p + 1, 16, &data->byte)) > + return -EPROTO; > return 0; > } > } -- Jean Delvare SUSE L3 Support -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v3 1/1] i2c: taos-evm: replace simple_strtoul by kstrtou8
Hi Andy, On Wed, 18 Nov 2015 18:26:25 +0200, Andy Shevchenko wrote: > On Wed, Nov 18, 2015 at 2:55 PM, LABBE Corentin > wrote: > > The simple_strtoul function is marked as obsolete. > > This patch replace it by kstrtou8. > > > > Only one concern. simple_strto* goes through the string until it has > an invalid character or \0. In your case kstrtou8 will fail the > transfer. So, is there possible cases when HW returns such data? It's not supposed to happen. > And just a style nitpicks below. > > > if (p[0] == 'x') { > > - data->byte = simple_strtol(p + 1, NULL, 16); > > + /* > > +* voluntarily dropping error code of kstrtou8 > > since all > > -> Voluntarily… > > > +* error code that it could return are invalid > > according > > +* to Documentation/i2c/fault-codes > > -> …codes. > > > +*/ > > + if (kstrtou8(p + 1, 16, &data->byte)) > > + return -EPROTO; > -- Jean Delvare SUSE L3 Support -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v2] i2c: cadence: Move to sensible power management
On Thu, Oct 29, 2015 at 8:27 PM, Shubhrajyoti Datta wrote: > On Wed, Oct 28, 2015 at 9:48 PM, Sören Brinkmann > wrote: >> Hi Shubhrajyoti, >> >> >> On Wed, 2015-10-28 at 12:56PM +0530, Shubhrajyoti Datta wrote: >>> Currently the clocks are enabled at probe and disabled at remove. >>> Which keeps the clocks enabled even if no transaction is going on. >>> This patch enables the clocks at the start of transfer and disables >>> after it. >>> >>> Also adapts to runtime pm. >>> Remove xi2c->suspended and use pm runtime status instead. >>> >>> converts dev pm to const to silence a checkpatch warning. >>> >>> Signed-off-by: Shubhrajyoti Datta >> >> To me, this looks all good. Just one small concern below. > > Thanks for the review. Soren , Do are you ok with the change or do you want me to resend without the suspended flag change. <> >> >> There might have been a reason to store this flag here. Did you test >> this with lockdep and CONFIG_DEBUG_ATOMIC_SLEEP? Just to make sure that >> nothing that can sleep is called from atomic context. > Done now. > > > Essentially this is a flag is set in suspend routine. and checked in > the isr I use > pm_runtime_suspended(id->dev) instead. > >> >> Sören >> -- >> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in >> the body of a message to majord...@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html >> Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] i2c: xlr: add support for Sigma Designs controller variant
Mans Rullgard writes: > Sigma Designs chips use a variant of this controller with the following > differences: > > - The BUSY bit in the STATUS register is inverted > - Bit 8 of the CONFIG register must be set > - The controller can generate interrupts > > This patch adds support for the first two of these. It also calculates > and sets the correct clock divisor if a clk is provided. The bus > frequency is optionally speficied in the device tree node. > > Signed-off-by: Mans Rullgard > --- > drivers/i2c/busses/Kconfig | 6 ++-- > drivers/i2c/busses/i2c-xlr.c | 81 > +--- > 2 files changed, 80 insertions(+), 7 deletions(-) Any comments on these patches? -- Måns Rullgård m...@mansr.com -- To unsubscribe from this list: send the line "unsubscribe linux-i2c" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html