From patchwork Thu May 25 09:03:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 98915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp222925vqr; Thu, 25 May 2023 02:13:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61HEyEr5kJoo0DB6BbV1n6gKfuWM+ouN8mLn+s00Cb/WUCeSL5c1ChZzxFIV8WMzGHvVnK X-Received: by 2002:a05:6a00:805:b0:63d:6744:8cae with SMTP id m5-20020a056a00080500b0063d67448caemr2792873pfk.2.1685005999058; Thu, 25 May 2023 02:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685005999; cv=none; d=google.com; s=arc-20160816; b=l45Tbx8vzuTvjDdt+5vCKSi+OQvCN2IlSYP8hM37PdxpD3psKnz7oWHa8DKgQYDHbC dxcBsr9NAi1XT9n+2d45f9rpQD/JZTcS3orPvIhRHLS4IREg5pidS4Gsbdiby6XD9Iw/ Q6cyeduFHFcWiZAIctGDGvfTqZNlTLaJxOU4eZVGfYCBHvXrz7J5NS+Hz04CHKv04Dnz y8LcceGr2poM0v3CNvRDPwt7BhGslgauNHkim1maojSrNFFmE/EphWdgKMLcoEtg7p3c sn4ZuUsJ3RusB5fyYM9H/bcJIlzErd29Se2QKmeuqo4lN+2wLGk//B1BWO37zZ7ondsC 2CuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=SYMdS4W4N0xwAoPb8PeUMR2257czRWSttZ9zPAtyhjU=; b=WOVUnnCQkMIKyb1IQrmd8aWXO9QeY5UtJE9Pmg4odi1uz+8UM3wHZ6/oAaVRbQK/Cf rynksAoVlUlIy8OuF55kBdggFUyTvC0XqX0/QZierpi5hNQBlEk6VMNKFuCMcRX8u6+J FjXSBHUoIZk+G0eFe3ZVifu4FM13m5P9UBdQT6mJdZgnmCPdPCXrPOW7ll80NWlh47j0 JoWwI6djCSpVjiyCY068GJ9CpF5TmRpyFEWpxDalmiifqbNI7E2cuU5xd16K716a+YxV DUjSCVXbydt9b/kwA4xvyywBLpXBMPwtbBMMNL4R+3FzAH87w9zItI1NQ7zS5RYaFz55 f76Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cWC2chZ3; 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=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q15-20020aa7842f000000b0064f6a531c88si1000485pfn.323.2023.05.25.02.13.03; Thu, 25 May 2023 02:13:19 -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=@linaro.org header.s=google header.b=cWC2chZ3; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240259AbjEYJDz (ORCPT + 99 others); Thu, 25 May 2023 05:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46898 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232918AbjEYJDw (ORCPT ); Thu, 25 May 2023 05:03:52 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62333195 for ; Thu, 25 May 2023 02:03:51 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-3f6da07feb2so2321125e9.0 for ; Thu, 25 May 2023 02:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685005430; x=1687597430; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=SYMdS4W4N0xwAoPb8PeUMR2257czRWSttZ9zPAtyhjU=; b=cWC2chZ38o3WioSon3DB+UowsUGimisgq83DdtqvLCSXahW7tFSqPy0wOhws8adp/W M6SIILH+rBXGXibAEwauRzc4AYxN79G2TtgMB2BFwy7rf9r41ce8q/EkSQd7jiQbYyfO 1tfDAhDrdeHHUA6MvmUUf4OzwuxjJkwCYEnT/uWGq6g/nu7HdCq9khpuU+ZdCHTDYUBN gi1kZ8H/M4xFbMVUuB3wm8RT9GxC2uaySgHrnHdxCUdsPe4pnsdmozioCJDFjqfFoU3X 086rz3ta47a07Vr9zmUO3SiBzSQiyidu1/cxDQhL5tjDm9nNGLGlvSMxQVGRhQmM+4Gc 6RbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685005430; x=1687597430; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SYMdS4W4N0xwAoPb8PeUMR2257czRWSttZ9zPAtyhjU=; b=bqiqxyLConMcSkXf9S93CwSZtvBV0GtYSwDLJ4WQq5YzLhSLNSC9Wj2dOr0bv5Saei CfSTBFZh78vLo0XXfOEWA1wVAACzYKKF7uHt9cpDE5ivkt3SP5LvZwTVvjBwyrCY4WFq vjM2aGlNLayXT9izgcIYLH9rq2/4qDvFdoRrbhJZFSqpvHwtph5bVvELNf2FHaeNq0Q6 9RanieA+B/vBpL8IRqxkKYZzcHGQsaMZZNndHNB+4Yb6N30yTxCW1+HDO82Xw91ghEr0 x+ZHnQMoyYLlksWjHGKzvUbYasNDNzglOLWsOcZMJWZ/4mPlWA1aNGbhV1+Zr0O6ke+o zKIA== X-Gm-Message-State: AC+VfDw3eiWdpIQA1Pmi1ISYA87/1zibP7DEY8Sx8DiWZz6ZCqgA9Qz3 xTX2pI4cf9KNB1NIqnb4EX286g== X-Received: by 2002:a1c:7705:0:b0:3f6:3e9:e8fc with SMTP id t5-20020a1c7705000000b003f603e9e8fcmr1756328wmi.10.1685005429892; Thu, 25 May 2023 02:03:49 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id l21-20020a1c7915000000b003f603b8eb5asm1396646wme.7.2023.05.25.02.03.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 02:03:47 -0700 (PDT) Date: Thu, 25 May 2023 12:03:45 +0300 From: Dan Carpenter To: Julien Panis Cc: Lee Jones , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] mfd: tps6594: Fix an error code in probe() Message-ID: <49f7cd8f-f7eb-40f1-91e8-291620c684df@kili.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766856850097785485?= X-GMAIL-MSGID: =?utf-8?q?1766856850097785485?= These error paths accidentally return success when they should return -EINVAL. Fixes: 325bec7157b3 ("mfd: tps6594: Add driver for TI TPS6594 PMIC") Signed-off-by: Dan Carpenter --- drivers/mfd/tps6594-i2c.c | 2 +- drivers/mfd/tps6594-spi.c | 2 +- 2 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/tps6594-i2c.c b/drivers/mfd/tps6594-i2c.c index 449d5c61bc9f..50a3cd03b3b0 100644 --- a/drivers/mfd/tps6594-i2c.c +++ b/drivers/mfd/tps6594-i2c.c @@ -222,7 +222,7 @@ static int tps6594_i2c_probe(struct i2c_client *client) match = of_match_device(tps6594_i2c_of_match_table, dev); if (!match) - return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n"); + return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); tps->chip_id = (unsigned long)match->data; crc8_populate_msb(tps6594_i2c_crc_table, TPS6594_CRC8_POLYNOMIAL); diff --git a/drivers/mfd/tps6594-spi.c b/drivers/mfd/tps6594-spi.c index a938a191744f..f4b4f37f957f 100644 --- a/drivers/mfd/tps6594-spi.c +++ b/drivers/mfd/tps6594-spi.c @@ -107,7 +107,7 @@ static int tps6594_spi_probe(struct spi_device *spi) match = of_match_device(tps6594_spi_of_match_table, dev); if (!match) - return dev_err_probe(dev, PTR_ERR(match), "Failed to find matching chip ID\n"); + return dev_err_probe(dev, -EINVAL, "Failed to find matching chip ID\n"); tps->chip_id = (unsigned long)match->data; crc8_populate_msb(tps6594_spi_crc_table, TPS6594_CRC8_POLYNOMIAL);