Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1322008rwd; Tue, 13 Jun 2023 07:43:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42hMliD9dcT2NIQi4k95gyRxBfroXxIaAtHj6Xr3Z1EfeK1c12o1SARGK8EW3tTczr8w4C X-Received: by 2002:a17:907:7244:b0:97e:a9ed:16bb with SMTP id ds4-20020a170907724400b0097ea9ed16bbmr9271896ejc.18.1686667411963; Tue, 13 Jun 2023 07:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686667411; cv=none; d=google.com; s=arc-20160816; b=FJpXMnReeuBFLQA6CTYV4gQT06SaILqbfoiNr+VOJ7a2arq4NBmAJD2O4Cw4768lmu HZgjndw14UxqTqYFQgq8uvgZW/TyeGHmge0ex3RyutRiIWbkNTirwWAMbE5jtw5oihzH 2IVociZfNFyAn1uth3ujYB55eYqIeTUAzdi+K7kZKs7TrZYUEz3c64dsLaKgdCG1T88a upCR0E1CLhSHlx0h33rp2gv1gRVSoBebgNpM/XlVcOa2cJZvWe+i43UB/iLH3N+pinTi 2/li5AujAuTYBJ7C+QiuhjaQ0FS/EwJfK/sRt2IRSa+aiL/bf1ORC4o9I1za24La/oUH XfwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mYrpKrCWGpmYXfpqNeBQYAFW/AkTpfBJh4b62sL0nSE=; b=l/6m9IhEWntsvaoZKtNza825/U8HYH+Emy7w20Ujztq4CrQT6GajEVj2QhdNkjq7+C vGbOb7QFlVRZYv96+e5GCe639MW7NKf8+tyvYHI2r1VnhtGm39EzM1Q2qI5orQc9oNwO 4E3Vb7Ecw/HyRI8T/78iiHhK3fH+e6pkFh7VHhY3G5MvLeBcUVcbCSqIRMTAsz2zjwsG Jy1ysQEghCC7KWzZChYkJ4xmupENlVTCBXuY0y+gCUx912RkOXkTXq5PiqFgFxyKooJK 4PYHB+UC78QYh7L3WTvw5bX8ckuTPQ/czJ7rl7zbFJ01oFFMdmOPSq5gFBJDP7rPuXDO 3rvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYkGKbz3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020a1709064ac200b0097394945fc6si6705649ejt.667.2023.06.13.07.43.06; Tue, 13 Jun 2023 07:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oYkGKbz3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240883AbjFMOWn (ORCPT + 99 others); Tue, 13 Jun 2023 10:22:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235921AbjFMOWm (ORCPT ); Tue, 13 Jun 2023 10:22:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06194EC; Tue, 13 Jun 2023 07:22:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0BFFA61846; Tue, 13 Jun 2023 14:22:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4A36C433F0; Tue, 13 Jun 2023 14:22:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686666160; bh=HhYD3JuRz7if0a7jlwfSjRUiZkCdi6uHJj+m0ZT47eY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oYkGKbz3KDGxIF/jJ+H42/VW/4dh3/H1Pr7VP7xpcU/Op/lhjsE3P0FQaWooW9w4Y iulaEOir/bzBNzwWsRIo4Z+e9qCdni7QS2JuVmKxPgRnQmooNJCmgTqNKTvlTxHRzG qDvimneaSLuBcObl6xmle2Z1yz32Joy/v+GN6z4rBxKbwmW3Q9VlPO7tZ9/7Z7VYVc j68hoGMLZ5gyF699eKVghzXc4BWeAGIJlpMgqaPDE98PL/tjltE2uKmclCD5FDT9Er Rc3X297eSltupFIUVzVXeiRXkHQq/RvNz9Qz9JqnhJBD2x7Sj+SHuN1+m1H5ZAd/Vq 37qe9M6MUPVhQ== Date: Tue, 13 Jun 2023 15:22:35 +0100 From: Mark Brown To: Okan Sahin Cc: Liam Girdwood , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Ibrahim Tilki , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH v1 2/2] regulator: max77857: Add ADI MAX77857/MAX77831 Regulator Support Message-ID: <6e75f1b5-db99-43c8-aae9-132269b2eb89@sirena.org.uk> References: <20230613080552.4492-1-okan.sahin@analog.com> <20230613080552.4492-3-okan.sahin@analog.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="O1QQbi+LWYO5tBXP" Content-Disposition: inline In-Reply-To: <20230613080552.4492-3-okan.sahin@analog.com> X-Cookie: Not a flying toy. X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --O1QQbi+LWYO5tBXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jun 13, 2023 at 11:05:50AM +0300, Okan Sahin wrote: > +struct regmap_config max77857_regmap_config = { > + .reg_bits = 8, > + .val_bits = 8, > + .cache_type = REGCACHE_RBTREE, Please use the more modern REGCACHE_MAPLE for new devices. > +static irqreturn_t max77857_irq_handler(int irq, void *data) > +{ > + struct regulator_dev *rdev = data; > + enum max77857_id id = (enum max77857_id)rdev_get_drvdata(rdev); > + struct device *dev = &rdev->dev; > + unsigned long flags = 0; > + unsigned int status; > + int ret; > + > + switch (id) { > + case ID_MAX77831: > + case ID_MAX77857: > + ret = regmap_read(rdev->regmap, MAX77857_REG_INT_SRC, &status); > + break; > + default: > + return IRQ_HANDLED; > + } We just completely ignore the interrupt if it's not one of the supported devices, that seems wrong - it looks likee those devices don't have the support for interrupts at all and so should never get here? If the interrupt does go off then this is likely to lead to problems. I think it'd be better if the driver just didn't request the interrupt for devices that it doesn't support interrupts for, if there's no interrupt support in the hardware for those it could also complain if one is specified though that's optional. > + if (ret) { > + dev_err(dev, "cannot read status\n"); > + return IRQ_HANDLED; > + } IRQ_NONE. --O1QQbi+LWYO5tBXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmSIe6oACgkQJNaLcl1U h9CuNQf+KFgyY6janu6dhTtJn4QR9TZ65kzcshdAxrYQ37D1QUPNq8H2MUfnMoMW K19+vVoPm9DfKAFyasTEk4vhzSWqu+uWiIXwC1NWUq29JyPKq0NIzaxPIgLCgDi/ ZDGBCwYg9yZE7Y3Gu6vQoo6Xn9u5mCYX4HWKcFNGFPHNuASC213kPMPeLx/S8UkS OjzW0s9LPYrm/Dq/ZGcL6lkNBixD0gqjarU2HsA14hqWhnIR9+NfbboScNRv1o2a 6AHKQVY29PCJ2ndCPqWQeZBOCZXZatL46OlbhnrUER0aGtsw+oJzpI+jXBBIThZw XGzBa1k2sxE4zeEC7KA4qVNpnHKhcg== =OgFa -----END PGP SIGNATURE----- --O1QQbi+LWYO5tBXP--