Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592141 > unrolled thread

Re: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support

Started byAndy Shevchenko <andy.shevchenko@gmail.com>
First post2017-03-03 18:10 +0100
Last post2017-03-04 07:10 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-03 18:10 +0100
    Re: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support Eva Rachel Retuya <eraretuya@gmail.com> - 2017-03-04 07:10 +0100

#1592141 — Re: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support

FromAndy Shevchenko <andy.shevchenko@gmail.com>
Date2017-03-03 18:10 +0100
SubjectRe: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support
Message-ID<tgYSl-4fZ-3@gated-at.bofh.it>
On Tue, Feb 28, 2017 at 4:37 AM, Eva Rachel Retuya <eraretuya@gmail.com> wrote:
> Add SPI driver that initializes SPI regmap for the adxl345 core driver.
> The driver supports the same functionality as I2C namely the x, y, z and
> scale readings.

Portion of minor comments.

> +config ADXL345_SPI
> +       tristate "Analog Devices ADXL345 3-Axis Digital Accelerometer SPI Driver"

> +       depends on !(INPUT_ADXL34X=y || INPUT_ADXL34X=m)

Same question. Would it be just

depends on INPUT_ADXL34X=n

?

> +        /* Setting bits 7 and 6 enables multiple-byte read */
> +       .read_flag_mask = BIT(7) | BIT(6),

GENMASK(7, 6) ?

> +static int adxl345_spi_probe(struct spi_device *spi)
> +{

> +       struct regmap *regmap;
> +       const struct spi_device_id *id = spi_get_device_id(spi);

Reverse order.

And usually we do assignments from function parameters first.

> +               dev_err(&spi->dev, "Error initializing spi regmap: %d\n",
> +                       (int)PTR_ERR(regmap));

Ugly casting!

-- 
With Best Regards,
Andy Shevchenko

[toc] | [next] | [standalone]


#1592397

FromEva Rachel Retuya <eraretuya@gmail.com>
Date2017-03-04 07:10 +0100
Message-ID<thb3b-4zi-3@gated-at.bofh.it>
In reply to#1592141
On Fri, Mar 03, 2017 at 06:55:26PM +0200, Andy Shevchenko wrote:
> On Tue, Feb 28, 2017 at 4:37 AM, Eva Rachel Retuya <eraretuya@gmail.com> wrote:
> > Add SPI driver that initializes SPI regmap for the adxl345 core driver.
> > The driver supports the same functionality as I2C namely the x, y, z and
> > scale readings.
> 
> Portion of minor comments.
> 
> > +config ADXL345_SPI
> > +       tristate "Analog Devices ADXL345 3-Axis Digital Accelerometer SPI Driver"
> 
> > +       depends on !(INPUT_ADXL34X=y || INPUT_ADXL34X=m)
> 
> Same question. Would it be just
> 
> depends on INPUT_ADXL34X=n
> 
> ?
> 
> > +        /* Setting bits 7 and 6 enables multiple-byte read */
> > +       .read_flag_mask = BIT(7) | BIT(6),
> 
> GENMASK(7, 6) ?
> 

True, but I would like to keep this as is. It is more readable and
obvious than GENMASK().

> > +static int adxl345_spi_probe(struct spi_device *spi)
> > +{
> 
> > +       struct regmap *regmap;
> > +       const struct spi_device_id *id = spi_get_device_id(spi);
> 
> Reverse order.
> 
> And usually we do assignments from function parameters first.

Ack.

Thanks,
Eva
> 
> > +               dev_err(&spi->dev, "Error initializing spi regmap: %d\n",
> > +                       (int)PTR_ERR(regmap));
> 
> Ugly casting!
> 
> -- 
> With Best Regards,
> Andy Shevchenko

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web