Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp888685rdb; Fri, 20 Oct 2023 02:20:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbMGKPCmURiNWiLptwKspg9klEvgD/f2OSW9ptTYmmI2QMVnYbU+IHhIPoGxNv8FeAL0+6 X-Received: by 2002:a25:b9cf:0:b0:d9a:5908:a29 with SMTP id y15-20020a25b9cf000000b00d9a59080a29mr1089107ybj.64.1697793603376; Fri, 20 Oct 2023 02:20:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697793603; cv=none; d=google.com; s=arc-20160816; b=doG6i+RsV4y9zBDmahBAgYgmUAa6TWHLyQ11blArtRijwLqRDA8FOuw0Gzu+WziyV2 31pw4z1RlGWnHvzn/S7Jg6KJTOewGu56vtwGOtFMJiiW7odm3ekECnomQyBIGBQ0mYf6 YtsL1VEePnlxl9kO/7JOEm9n0b+q94LcmDbkk893Hm09f3oBL5HKrVO1WaANNY50ceIG M4h21izC3b4bTAuXWKayNIvTr5UIBi71SoRcYwRQZKMrZx9eMbpUBas/pjcC4ZO4rJMN 76sIEbaufFaO3t2tjrcjgAR3jvs9tzIAOHNhxS/pe3g0P+ys/WEUrFyEpzStQGWHm1wr BvKg== 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 :message-id:date:subject:cc:to:from; bh=7H8WDVfFDR61Rg90du78JiGD91n88zv2vz+dWzod/IM=; fh=bfCYhkElhvhiTh2Bb1uYXjQJ3b8tlaLdwMgVxHDG16Y=; b=rQ3YI+rmGMJ894RA4XCNBDWQCAu+tYg1si6wuwd3VVo7nnHa1FuDlKm0Nuemfdxru7 SaP9bk8sx7KJgQdavTCi+6t5vtpNYOvehZxKwPnAzXkxwYT6wohdUiMZUT+7xWMagtiA A4UUWst52KCdwZ4oybaziiEo1bnfHQQ/XXCmUlTF6ct6+A6H1FtRRcKtbgudjCowtsHR AGRpBbJXxeE647GbHTZ9jG04/jJSNBRdUMf5j8pfprn2sD9SEc50poCvuFF9TZQZqZ/c ofe6OvC3qmKBD9whzCyt6Ra5edxrrzFV7ZUGxBTY6LVV2NdltBscPDnelS6Im6CwgHaf sFDA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id a17-20020a056a000c9100b00691019fd0efsi1623107pfv.75.2023.10.20.02.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 02:20:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EAD6C825A85C; Fri, 20 Oct 2023 02:20:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376601AbjJTJTp (ORCPT + 99 others); Fri, 20 Oct 2023 05:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376523AbjJTJTo (ORCPT ); Fri, 20 Oct 2023 05:19:44 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id A9DE8AB; Fri, 20 Oct 2023 02:19:42 -0700 (PDT) Received: from localhost.localdomain (unknown [180.167.10.98]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 2FE38604F6624; Fri, 20 Oct 2023 17:19:40 +0800 (CST) X-MD-Sfrom: suhui@nfschina.com X-MD-SrcIP: 180.167.10.98 From: Su Hui To: pavel@ucw.cz, lee@kernel.org Cc: Su Hui , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] leds: lp5521: add an error check in lp5521_post_init_device Date: Fri, 20 Oct 2023 17:19:31 +0800 Message-Id: <20231020091930.207870-1-suhui@nfschina.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 20 Oct 2023 02:20:01 -0700 (PDT) lp55xx_write() can return an error code, add a check for this. Signed-off-by: Su Hui --- drivers/leds/leds-lp5521.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 2ef19ad23b1d..f9c8b568b652 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c @@ -301,6 +301,8 @@ static int lp5521_post_init_device(struct lp55xx_chip *chip) /* Set all PWMs to direct control mode */ ret = lp55xx_write(chip, LP5521_REG_OP_MODE, LP5521_CMD_DIRECT); + if (ret) + return ret; /* Update configuration for the clock setting */ val = LP5521_DEFAULT_CFG; -- 2.30.2