Re: [PATCH 1/2] iio: adxl345: add spi-3wire

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/03/2024 01:32, Lothar Rubusch wrote:
> 
>>> +
>>>       /* Bail out if max_speed_hz exceeds 5 MHz */
>>>       if (spi->max_speed_hz > ADXL345_MAX_SPI_FREQ_HZ)
>>>               return dev_err_probe(&spi->dev, -EINVAL, "SPI CLK, %d Hz exceeds 5 MHz\n",
>>>                                    spi->max_speed_hz);
>>>
>>>       regmap = devm_regmap_init_spi(spi, &adxl345_spi_regmap_config);
>>> -     if (IS_ERR(regmap))
>>> -             return dev_err_probe(&spi->dev, PTR_ERR(regmap), "Error initializing regmap\n");
>>> +     if (IS_ERR(regmap)) {
>>> +             dev_err_probe(&spi->dev, PTR_ERR(regmap), "Error initializing spi regmap: %ld\n",
>>> +                           PTR_ERR(regmap));
>>> +             return PTR_ERR(regmap);
>>
>> Why are you changing correct code into incorrect?
> 
> I'll adjust that. It looks odd, I agree, but is this incorrect code? I found
> similar code in the neighbor adxl313 accel driver. I may change/update
> that then, too. Thank   you for the hints.

Please explain why you are doing this. How is this related to adding SPI
3-wire mode?


Best regards,
Krzysztof





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux