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


Groups > linux.kernel > #1592141

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

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 4/4] iio: accel: adxl345: Add SPI support
Date 2017-03-03 18:10 +0100
Message-ID <tgYSl-4fZ-3@gated-at.bofh.it> (permalink)
References <tfFRL-6hE-5@gated-at.bofh.it> <tfHJT-7FS-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

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

csiph-web