Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1956183rdh; Sat, 25 Nov 2023 08:15:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IHxHIWhE5/3+SlevpnX75YazA3rVX44ZQRac6ykYRr04MMk8QKDXrHWc3H2YhBUMYiCHP2W X-Received: by 2002:a17:902:cf43:b0:1cf:c2dc:1c2c with SMTP id e3-20020a170902cf4300b001cfc2dc1c2cmr16668plg.52.1700928936756; Sat, 25 Nov 2023 08:15:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700928936; cv=none; d=google.com; s=arc-20160816; b=KIOJ+11UO7efu5az/5J5A1NfzsBpL8ZLVbXFeLAjydi1gIsTsSx/z2we/geOKrDz/v k/wQXivsKKv1xhwXnjcolLUhpsI0rbvNtC/R6FZMohfZZ+dYnOdkc2GwOpqMnoRpqrOM IAhcV85itEKFGE3wCsOMe/PbYYwRBUP+DaSA7GPd2qIrgkyAB2imCnNeWILdi+sPUNxR DZL0YwGDu8fOCjQmYFOjRGBfDCiK90bWBxvLFqqtSTZuyXAgLpdSfBOWK32meJs6QU5e XgOrCb2LQDuWHv7JT9C0364WlD7J9e5qv1PD5chXHXp/g7cubRyhE6aFgotm72e5DjFE lOZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Msn1MtGPXRz7Ecz+Oc6kP5rtc0Ya3fADdG6fka4CEPE=; fh=ESPtyGfxO2/njBQIL8vjsGAP9XGYUG/mWqSAPV+GTUY=; b=n7Ajfc/MAFouI3qCnAt93ujmxaXo4q94zSlsfYPfQTu68hogtMVduFVgikAvpRtgPp eTGbsWYZQ6YL6+pk2jB2G0PystHHO0XcnF/74UH6nbIwf6dKjGE9bJXQk3wyUQcDqYdh VHJNmBGe3pfqSpwi/90Te0OUwYcnnHgRSXBE9Ow+Pb5ZFywgCphrQy18kG0+xVD2oVl3 I/rX4g9OQmfnFqa/I+vFMdaCAtMhWX9nH5MyIhzH1ZQj9IiDVnFxbA+38uEXg40DzmI0 jrY6dWYC4yWCeuFAYKcwPJKQnPlcq9heDxKrwO/dBrYRqr+gXLv/S/CuGNuI1eWQJLPa BFoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tej3oOMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id m4-20020a170902768400b001cfb4505c2csi1625689pll.28.2023.11.25.08.15.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 08:15:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Tej3oOMZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 834438023752; Sat, 25 Nov 2023 08:15:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232276AbjKYQNN (ORCPT + 99 others); Sat, 25 Nov 2023 11:13:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232230AbjKYQNM (ORCPT ); Sat, 25 Nov 2023 11:13:12 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E0CFD92 for ; Sat, 25 Nov 2023 08:13:18 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 433F4C433C7; Sat, 25 Nov 2023 16:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700928798; bh=SC6r2enSVMPPwuOivo7HJSkxH1xec3XgzYtzK0Z2Zwg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Tej3oOMZ8KX/iNNwFL13dS9OhCryXzjQfCAw8XR/RyaYPW/6VuknIZbW/dAk0Bn1Q 0+OTogNXfNyWTesm5fU0ptjcICj1FXobceg61uV/FKIxarpRx66+SsgLOJ0pmmTA7v ntLVacLrbTzsMizOsLsp+DByRdWVYjt1ROGi5G09LxFUPwh9YLavlV2A4umUMyJDrF 3lt5K+kpp/6wz0Fnj/fu95Va4nmzCjLAz0zsOqWpjDjZqapHzgGz7P97FJSfbsmTSJ YgTXOploLlKKRKM+9m/r4cczUsNlP6SgHDv/TJ3/w5pZUkthfmHsY3y8fceSlMdfQ8 67nZ/9LV3Kohg== Date: Sat, 25 Nov 2023 16:13:13 +0000 From: Jonathan Cameron To: Marcelo Schmitt Cc: , , , , , , , , , Subject: Re: [PATCH v2 1/7] iio: adc: ad7091r-base: Set alert config and drvdata Message-ID: <20231125161313.71aa345b@jic23-huawei> In-Reply-To: References: X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 25 Nov 2023 08:15:34 -0800 (PST) On Thu, 23 Nov 2023 13:40:16 -0300 Marcelo Schmitt wrote: Hi Marcelo, Thanks for the patch. Content looks fine but it wants breaking up into 2 fixes and one reformat. > Write 1 to bit 4 in the configuration register to set ALERT/BUSY/GPO pin > to be used as ALERT. That's s one fix. > Set device driver data so it can be retrieved when handling alert > events, avoiding null pointer dereference. That's one fix - so this should be at least 2 patches. > > Fixes: (iio: adc: Add support for AD7091R5 ADC) That's not the syntax for a fixes tag. > Signed-off-by: Marcelo Schmitt > --- > drivers/iio/adc/ad7091r-base.c | 12 ++++++++++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > > diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c > index 8e252cde735b..3ecac3164446 100644 > --- a/drivers/iio/adc/ad7091r-base.c > +++ b/drivers/iio/adc/ad7091r-base.c > @@ -28,6 +28,7 @@ > #define AD7091R_REG_RESULT_CONV_RESULT(x) ((x) & 0xfff) > > /* AD7091R_REG_CONF */ > +#define AD7091R_REG_CONF_ALERT_EN BIT(4) > #define AD7091R_REG_CONF_AUTO BIT(8) > #define AD7091R_REG_CONF_CMD BIT(10) > > @@ -232,9 +233,16 @@ int ad7091r_probe(struct device *dev, const char *name, > iio_dev->channels = chip_info->channels; > > if (irq) { > + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, > + AD7091R_REG_CONF_ALERT_EN, BIT(4)); > + if (ret) > + return ret; > + > + dev_set_drvdata(st->dev, iio_dev); > ret = devm_request_threaded_irq(dev, irq, NULL, > - ad7091r_event_handler, > - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, st); > + ad7091r_event_handler, > + IRQF_TRIGGER_FALLING | > + IRQF_ONESHOT, name, st); This is alignment cleanup. Should not be in a fix. > if (ret) > return ret; > }