Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3115754rdh; Mon, 27 Nov 2023 06:52:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IFGueZmgung7IgftJ1VytsfIp95wo3dD1W/rCfwUFe+XSGpLUCJg64NOnWaHQEvmOIbJL3j X-Received: by 2002:a05:6a20:da8c:b0:18c:ae32:50fa with SMTP id iy12-20020a056a20da8c00b0018cae3250famr2058665pzb.35.1701096745968; Mon, 27 Nov 2023 06:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701096745; cv=none; d=google.com; s=arc-20160816; b=Ibnu2fo+vrslvPq0tSzR9C/LHXelQGlk+Qt5Fzhd6qIxE+AoUuJ7Fj5Su6/CTdx+Vc ByGT9OkgTI1MYhyr4l4MSPvpj4TtnydRF6E5Z2jeoxDdWxrt3wrOu4FbE6oQr+NqnYkX ruF93EXl7uQHFaQD9x2pQc3rlr5C7OoJSoh5fDkSx0368A4rSvCQEJ2qN4ehPuq9WK28 IjFd3rCDn27EHIXmjeasF/8SUKzoC6PCl0zVttj6JhMp4YSbzUIEFdf9W6TdwKCczcuJ /kLHqRYFbpJAxuFBP1Ci8woIo22MNqDFMubqozOW/ZOwjPghc66aW6cnlCyHM/jvgyJT 3rVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=kcr3CAPjvM7RAzYgAVJ54nu7H1Z0vqjPoUncJfKtUjM=; fh=4IpLa0b3E9zNpEaCCdd6AMLNfQnN6FX+GcsNfPwFGeI=; b=RUnj74PFQtIZDalx14d6LejZEeNpCrDWKUf93L5N0vh6ov2xp8Vmdp0PqCsAuXe1xP /5qiBJx1QKBLMerFmW27V+PzV5x2TtezD5retYzsXHg3aXnhZtVSHEF1QMRUBXYJqx8h xcAbXQFHbi32Ds+xAb5E9Qv1wi/3dWNpCuanrG+NrHv8ApoLE0G0Fxs1WVDoKoQLLWaV 8lJZi4GGt8wqHSJqI+BeAYOJ27Yn8NSQIDLXK9w2xJbD8lqCGsDeE2DbHifhCtWcPT6W ZFuEjkVVHxsVFlDRjQx9PyFMmIW/Q1YbRfVkkZAM29Lsci00JQZ2Iu5J3JuempihXdGz PhmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Z87GTetn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id 16-20020a631650000000b005c233bce486si6717995pgw.116.2023.11.27.06.52.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 06:52:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Z87GTetn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 508A980C61B3; Mon, 27 Nov 2023 06:52:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233601AbjK0OwI (ORCPT + 99 others); Mon, 27 Nov 2023 09:52:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233863AbjK0Ovr (ORCPT ); Mon, 27 Nov 2023 09:51:47 -0500 Received: from m12.mail.163.com (m12.mail.163.com [220.181.12.215]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6AD2CD4E; Mon, 27 Nov 2023 06:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=kcr3CAPjvM7RAzYgAV J54nu7H1Z0vqjPoUncJfKtUjM=; b=Z87GTetnWsEoVgdzWVhIOC2S0xI0mIKwcC LYgbo9nV4S38m82QLn2hy7IZxji1h1HvL3o0jio0U/OGl4VBo9u090Ubmu6yLuM6 xqjQY7Jxda1IpIGL0v/ckl/Y87eikaDAKENAyhddNS8vq4JLi4yypOluxza2K+nc uI1GLDP1k= Received: from localhost.localdomain (unknown [39.144.190.126]) by zwqz-smtp-mta-g3-2 (Coremail) with SMTP id _____wCHrzLarGRlak9rEA--.27728S2; Mon, 27 Nov 2023 22:51:07 +0800 (CST) From: Haoran Liu To: richard.henderson@linaro.org Cc: ink@jurassic.park.msu.ru, mattst88@gmail.com, linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, Haoran Liu Subject: [PATCH] alpha: Improve error handling in alpha_rtc_init Date: Mon, 27 Nov 2023 06:51:03 -0800 Message-Id: <20231127145103.29912-1-liuhaoran14@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: _____wCHrzLarGRlak9rEA--.27728S2 X-Coremail-Antispam: 1Uf129KBjvdXoW7Gr4DAry5Zw4kWr1UGFyxGrg_yoW3Gwc_Kr 1Sv34kWFyxCF4qvF45Aw43Zr4Sya95Krs5tw12qFWjy34fXF1rZ398JF13Xr15GF48CFZ2 grn8Gryvyr1xKjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7xRZuciUUUUUU== X-Originating-IP: [39.144.190.126] X-CM-SenderInfo: xolxxtxrud0iqu6rljoofrz/xtbBcgE1gletj1OaTgABs3 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 morse.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 (morse.vger.email [0.0.0.0]); Mon, 27 Nov 2023 06:52:23 -0800 (PST) This patch enhances the alpha_rtc_init function in arch/alpha/kernel/rtc.c by adding error handling for the platform_device_register_simple call. Signed-off-by: Haoran Liu --- arch/alpha/kernel/rtc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/alpha/kernel/rtc.c b/arch/alpha/kernel/rtc.c index fb3025396ac9..576397b1fac2 100644 --- a/arch/alpha/kernel/rtc.c +++ b/arch/alpha/kernel/rtc.c @@ -209,6 +209,9 @@ alpha_rtc_init(void) init_rtc_epoch(); pdev = platform_device_register_simple("rtc-alpha", -1, NULL, 0); + if (IS_ERR(pdev)) + return PTR_ERR(pdev); + rtc = devm_rtc_allocate_device(&pdev->dev); if (IS_ERR(rtc)) return PTR_ERR(rtc); -- 2.17.1