Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf235277 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Jonathan Cameron
Browse files

iio: imu: st_lsm6dsx: simplify data ready pin parsing



Simplify st_lsm6dsx_of_get_drdy_pin routine since of_property_read_u32
error conditions are already managed in st_lsm6dsx_get_drdy_reg()

Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@st.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent b4bac145
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -559,19 +559,11 @@ static const unsigned long st_lsm6dsx_available_scan_masks[] = {0x7, 0x0};
static int st_lsm6dsx_of_get_drdy_pin(struct st_lsm6dsx_hw *hw, int *drdy_pin)
{
	struct device_node *np = hw->dev->of_node;
	int err;

	if (!np)
		return -EINVAL;

	err = of_property_read_u32(np, "st,drdy-int-pin", drdy_pin);
	if (err == -ENODATA) {
		/* if the property has not been specified use default value */
		*drdy_pin = 1;
		err = 0;
	}

	return err;
	return of_property_read_u32(np, "st,drdy-int-pin", drdy_pin);
}

static int st_lsm6dsx_get_drdy_reg(struct st_lsm6dsx_hw *hw, u8 *drdy_reg)