From 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:44:59 +0000 Subject: [PATCH] gmac get mac form eeprom --- kernel/drivers/iio/gyro/adis16130.c | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/kernel/drivers/iio/gyro/adis16130.c b/kernel/drivers/iio/gyro/adis16130.c index aea80ab..b9c952e 100644 --- a/kernel/drivers/iio/gyro/adis16130.c +++ b/kernel/drivers/iio/gyro/adis16130.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-or-later /* * ADIS16130 Digital Output, High Precision Angular Rate Sensor driver * * Copyright 2010 Analog Devices Inc. - * - * Licensed under the GPL-2 or later. */ #include <linux/mutex.h> @@ -12,6 +11,8 @@ #include <linux/module.h> #include <linux/iio/iio.h> + +#include <asm/unaligned.h> #define ADIS16130_CON 0x0 #define ADIS16130_CON_RD (1 << 6) @@ -60,7 +61,7 @@ ret = spi_sync_transfer(st->us, &xfer, 1); if (ret == 0) - *val = (st->buf[1] << 16) | (st->buf[2] << 8) | st->buf[3]; + *val = get_unaligned_be24(&st->buf[1]); mutex_unlock(&st->buf_lock); return ret; @@ -77,9 +78,7 @@ switch (mask) { case IIO_CHAN_INFO_RAW: /* Take the iio_dev status lock */ - mutex_lock(&indio_dev->mlock); ret = adis16130_spi_read(indio_dev, chan->address, &temp); - mutex_unlock(&indio_dev->mlock); if (ret) return ret; *val = temp; @@ -156,7 +155,6 @@ indio_dev->name = spi->dev.driver->name; indio_dev->channels = adis16130_channels; indio_dev->num_channels = ARRAY_SIZE(adis16130_channels); - indio_dev->dev.parent = &spi->dev; indio_dev->info = &adis16130_info; indio_dev->modes = INDIO_DIRECT_MODE; -- Gitblit v1.6.2