From nobody Wed Feb 11 17:44:08 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D748DC7EE24 for ; Sun, 7 May 2023 14:47:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbjEGOrF (ORCPT ); Sun, 7 May 2023 10:47:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjEGOrC (ORCPT ); Sun, 7 May 2023 10:47:02 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09FF911D89 for ; Sun, 7 May 2023 07:47:01 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9659f452148so637335966b.1 for ; Sun, 07 May 2023 07:47:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683470819; x=1686062819; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Axa9RQ68hsv/IILOP7fge12GPPTaIZB7pViml3ZGK3o=; b=ZC5rF4Ww89xsCnZB/W2qSgvkRurCeynQHDEJfJW6nuYDODQpHQrra4uAfylCuJyNCf ofm0Z+scRP7HdD0yp1ZAGstWkbZLk7sBzo/vHoOHcwA1ISu4QD5NOQvC9093Fer/MAiJ eQuG5uNWVqwQeC/jlEIj42fpC1cKCtcZhKeX+W1FJsZp6RhHqSALH2LOoEc3dGsYkB+F q05aOknNjx1hAjS/pVzAbhmFarm/BhNCY6++DxWEJg5vUje0alJSYDjQw0XVf0vpqi2T cSeVz8nkSeg39nYMWr0O4RYzSimgecqjAPa9akDajGNbCSx93fdRS6NK7zgSAQqRHFnr O82A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683470819; x=1686062819; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Axa9RQ68hsv/IILOP7fge12GPPTaIZB7pViml3ZGK3o=; b=LVp7bISp97NWDD1B74LAklBeQQ1Oa+4QUIJUr1HfoRj/sGVuOcYZM+gvlSZRYlfDsT M9ka3qcLgAP2xKlq9iCVillE6cw6/Qk5L6/FdPaOCTo/px5IEZJ3MRjIrlXb30nrmiTR CeDwgpfsttSnsYZb6FmL5B5SrcIYSpsD/M/CEgY2zq62RMNy7G2P1LYCQ6kIO0KDYaET tgwkAiO5ddi119ypVbKMWsDVar13OW17ZgZxj39CWhsiknoFSjBlpeXn+YVpmT9Azba6 YNLkIADu6k5W4MpfPyqp0o5Cl23NK3rFWj94nsv9j0KWXPfnOqROzw3ZgMZ4cMmEzjWs OsgA== X-Gm-Message-State: AC+VfDxkDElce31ctiCDGjGU/QoXMPj7b42AvmowjYcnEqSyxQfjhIdv ibxGI8f8lGDQlXSORWCMWiLb/g== X-Google-Smtp-Source: ACHHUZ4z/mAGPq4xa//YhoiP75fH1bROCSH4dqKSxMFZxPU8cd7U9ak7duojvAubTAsoKbvfMk1jSw== X-Received: by 2002:a17:907:1687:b0:94e:1764:b0b5 with SMTP id hc7-20020a170907168700b0094e1764b0b5mr7742438ejc.69.1683470819525; Sun, 07 May 2023 07:46:59 -0700 (PDT) Received: from krzk-bin.. ([2a02:810d:15c0:828:1757:b51a:9965:e81]) by smtp.gmail.com with ESMTPSA id mm6-20020a170906cc4600b00958079b676asm3706913ejb.122.2023.05.07.07.46.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 May 2023 07:46:59 -0700 (PDT) From: Krzysztof Kozlowski To: Tony Lindgren , Liam Girdwood , Mark Brown , Jerome Neanne , linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org, khilman@baylibre.com, msp@baylibre.com, j-keerthy@ti.com Subject: [RESEND PATCH] regulator: tps65219: Fix matching interrupts for their regulators Date: Sun, 7 May 2023 16:46:56 +0200 Message-Id: <20230507144656.192800-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver's probe() first registers regulators in a loop and then in a second loop passes them as irq data to the interrupt handlers. However the function to get the regulator for given name tps65219_get_rdev_by_name() was a no-op due to argument passed by value, not pointer, thus the second loop assigned always same value - from previous loop. The interrupts, when fired, where executed with wrong data. Compiler also noticed it: drivers/regulator/tps65219-regulator.c: In function =E2=80=98tps65219_get= _rdev_by_name=E2=80=99: drivers/regulator/tps65219-regulator.c:292:60: error: parameter =E2=80=98= dev=E2=80=99 set but not used [-Werror=3Dunused-but-set-parameter] Fixes: c12ac5fc3e0a ("regulator: drivers: Add TI TPS65219 PMIC regulators s= upport") Cc: Signed-off-by: Krzysztof Kozlowski Reviewed-by: Markus Schneider-Pargmann --- Not tested. Sent two months ago and no comments, so resending. Cc: Jerome Neanne Cc: khilman@baylibre.com Cc: msp@baylibre.com Cc: j-keerthy@ti.com --- drivers/regulator/tps65219-regulator.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/regulator/tps65219-regulator.c b/drivers/regulator/tps= 65219-regulator.c index b1719ee990ab..8971b507a79a 100644 --- a/drivers/regulator/tps65219-regulator.c +++ b/drivers/regulator/tps65219-regulator.c @@ -289,13 +289,13 @@ static irqreturn_t tps65219_regulator_irq_handler(int= irq, void *data) =20 static int tps65219_get_rdev_by_name(const char *regulator_name, struct regulator_dev *rdevtbl[7], - struct regulator_dev *dev) + struct regulator_dev **dev) { int i; =20 for (i =3D 0; i < ARRAY_SIZE(regulators); i++) { if (strcmp(regulator_name, regulators[i].name) =3D=3D 0) { - dev =3D rdevtbl[i]; + *dev =3D rdevtbl[i]; return 0; } } @@ -348,7 +348,7 @@ static int tps65219_regulator_probe(struct platform_dev= ice *pdev) irq_data[i].dev =3D tps->dev; irq_data[i].type =3D irq_type; =20 - tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, rdev); + tps65219_get_rdev_by_name(irq_type->regulator_name, rdevtbl, &rdev); if (IS_ERR(rdev)) { dev_err(tps->dev, "Failed to get rdev for %s\n", irq_type->regulator_name); --=20 2.34.1