From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BBB42C2BA15 for ; Sun, 5 Apr 2020 17:14:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 90CB9206C3 for ; Sun, 5 Apr 2020 17:14:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586106867; bh=W65ai1oueEir50gFsszziEjG0Sb+T0esFzerZcyeo2o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=kFg/QfZ4wG6dr+zy+Bvsbc7fP47/ITldWzRPwjVhKKrRXobZMkWOpmhoGYfZtmi1V emG0PnD2Nk5RayFhq2SkWGL/4EJKOZ7W/ceqIG2tunCB2YTLuuoe9nuUVf0GbiWaUg cIRFGWTXYBz0LzG10YTxjpHLR7WiByhIKXJd/hXI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727081AbgDERO1 (ORCPT ); Sun, 5 Apr 2020 13:14:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:38038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726771AbgDERO1 (ORCPT ); Sun, 5 Apr 2020 13:14:27 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 55A1F20675; Sun, 5 Apr 2020 17:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586106865; bh=W65ai1oueEir50gFsszziEjG0Sb+T0esFzerZcyeo2o=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fWfmnoawTKN4guFn979lfobB6ly5wGoQxEcYBYuRYPsrEVjhESg9WIw8xdv/1rCV4 76UQDdaGfMkV3gyenYNzJrs0uPiPcuG8HQYptTwH2htjIceeTXFp9C80aWaNuI0JCx Ovrhqa5MuxBoPZoMEjDluEsgdxmSTX1FvC6815Lc= Date: Sun, 5 Apr 2020 18:14:22 +0100 From: Jonathan Cameron To: Lorenzo Bianconi Cc: Lorenzo Bianconi , linux-iio@vger.kernel.org Subject: Re: [PATCH] iio: imu: st_lsm6dsx: remove duplicated macro Message-ID: <20200405181422.13b0467c@archlinux> In-Reply-To: References: <20200405130724.70094f1c@archlinux> <20200405130912.5929ee08@archlinux> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Sun, 5 Apr 2020 14:35:51 +0200 Lorenzo Bianconi wrote: > > > > On Sun, 5 Apr 2020 13:07:24 +0100 > > Jonathan Cameron wrote: > > > > > On Sun, 5 Apr 2020 12:36:26 +0200 > > > Lorenzo Bianconi wrote: > > > > > > > Remove ST_LSM6DSX_REG_WHOAMI_ADDR duplicated macro and rely on ST sensor > > > > common definitions > > > > > > > > Signed-off-by: Lorenzo Bianconi > > > Applied. > > > > Actually no. I'd rather duplicate the value than have this > > largerly unconnected driver include that header with lots of other > > stuff in it. > > > > So dropped. > > actually I was thinking about it too but I guess we have the same > issue in shub for LIS3MDL so I just aligned to it: > https://github.com/LorenzoBianconi/linux-iio/blob/st_lsm6dsx_default_wai/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_shub.c#L96 Ah. I'd like to drop that include rather than introduce it in the other file. Thanks, Jonathan > > Regards, > Lorenzo > > > > > Thanks, > > > > Jonathan > > > > > > > > Thanks, > > > > > > Jonathan > > > > > > > --- > > > > drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 5 ++--- > > > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > > > > > diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > > > > index 84d219ae6aee..f3cf13b29d18 100644 > > > > --- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > > > > +++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c > > > > @@ -58,12 +58,11 @@ > > > > #include > > > > #include > > > > > > > > +#include > > > > #include > > > > > > > > #include "st_lsm6dsx.h" > > > > > > > > -#define ST_LSM6DSX_REG_WHOAMI_ADDR 0x0f > > > > - > > > > #define ST_LSM6DSX_TS_SENSITIVITY 25000UL /* 25us */ > > > > > > > > static const struct iio_chan_spec st_lsm6dsx_acc_channels[] = { > > > > @@ -1364,7 +1363,7 @@ static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id, > > > > return -ENODEV; > > > > } > > > > > > > > - err = regmap_read(hw->regmap, ST_LSM6DSX_REG_WHOAMI_ADDR, &data); > > > > + err = regmap_read(hw->regmap, ST_SENSORS_DEFAULT_WAI_ADDRESS, &data); > > > > if (err < 0) { > > > > dev_err(hw->dev, "failed to read whoami register\n"); > > > > return err; > > > > > >