From 1543e317f1da31b75942316931e8f491a8920811 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Thu, 04 Jan 2024 10:08:02 +0000 Subject: [PATCH] disable FB --- kernel/drivers/iio/dac/ad5624r_spi.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/kernel/drivers/iio/dac/ad5624r_spi.c b/kernel/drivers/iio/dac/ad5624r_spi.c index cc3a24c..ab4997b 100644 --- a/kernel/drivers/iio/dac/ad5624r_spi.c +++ b/kernel/drivers/iio/dac/ad5624r_spi.c @@ -1,9 +1,8 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * AD5624R, AD5644R, AD5664R Digital to analog convertors spi driver * * Copyright 2010-2011 Analog Devices Inc. - * - * Licensed under the GPL-2. */ #include <linux/interrupt.h> @@ -18,6 +17,8 @@ #include <linux/iio/iio.h> #include <linux/iio/sysfs.h> + +#include <asm/unaligned.h> #include "ad5624r.h" @@ -36,11 +37,9 @@ * for the AD5664R, AD5644R, and AD5624R, respectively. */ data = (0 << 22) | (cmd << 19) | (addr << 16) | (val << shift); - msg[0] = data >> 16; - msg[1] = data >> 8; - msg[2] = data; + put_unaligned_be24(data, &msg[0]); - return spi_write(spi, msg, 3); + return spi_write(spi, msg, sizeof(msg)); } static int ad5624r_read_raw(struct iio_dev *indio_dev, @@ -270,7 +269,6 @@ st->us = spi; - indio_dev->dev.parent = &spi->dev; indio_dev->name = spi_get_device_id(spi)->name; indio_dev->info = &ad5624r_info; indio_dev->modes = INDIO_DIRECT_MODE; -- Gitblit v1.6.2