From patchwork Thu May 27 22:00:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rasmus Villemoes X-Patchwork-Id: 1484893 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.a=rsa-sha256 header.s=selector1 header.b=KWyUvV1v; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FrhbB3vb4z9sCD for ; Fri, 28 May 2021 08:00:54 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id DC53282EE7; Fri, 28 May 2021 00:00:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=prevas.dk header.i=@prevas.dk header.b="KWyUvV1v"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EEA8782EE5; Fri, 28 May 2021 00:00:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FORGED_SPF_HELO,MSGID_FROM_MTA_HEADER, SPF_HELO_PASS autolearn=no autolearn_force=no version=3.4.2 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on0720.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::720]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C1D3C82D4B for ; Fri, 28 May 2021 00:00:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=reject dis=none) header.from=prevas.dk Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rasmus.villemoes@prevas.dk ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=keOn5KLYA677HuBFaKX4yoabGulYq5m0hov5C7KSVXnfr6CqvEodZa6MOZSqoXYb42c226VpYzD8dU5uxtDOSGysdYoahD5WaHsSpB3t8Fm+Dqy4qQMnQysFarzqCtUVyuXRZHg1jq2wOWXMZ0BmbL9GLaSv7zH1BO8MsfSh5jrJlgjlZq28QTeU0UGOCg9McLUErfWZha8OVObSNKNXaTKUd/XbEML/0/TEeUx63iyBuTtW9p/5h7l4niTLMsqSlMFWE8vsR8dpSXi0hmN1cvSMxx9XiC7NsQ6hARXYyefDOsMal9JXJAR2CfJpvk93FCSxtJd7t0/cCHP+vo0/Og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DxIHhUGjFeFutre3zVFVBQ8ozFjt4Jbewkl/JLb1od4=; b=VvvwqmuT23eiQD76AfnkrIScd2uPEQxzClbXq6vH2JUU302KPVwZFKcoFO7gf1EDY/LgyJGe/ntW8hjLMadwQUd/zdYfqvY1C7Sh4qLmvHj08+GHDqZMe8mz+pNl2tGVtvyPA8Ns+zQxAfhHlJaG27bep8+gRdlAnf4rCjXBnASQoxoTZmjxWm+v4Cwk7A+3MMxKb+cIVGzOVU/QUCjFdUjaMqfx4Ghe8Xg7AVFNqPQjMEMnPI2MErh8T+0gyVWIcgluKO2IOUTvitL2GuWcdtJy2Hjq6ryiLb2DAKE1pS3l9Ls5v++MFIx5bOY4Sa154Sb6ULLzemrOeiq0AOngXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=prevas.dk; dmarc=pass action=none header.from=prevas.dk; dkim=pass header.d=prevas.dk; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=prevas.dk; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DxIHhUGjFeFutre3zVFVBQ8ozFjt4Jbewkl/JLb1od4=; b=KWyUvV1vG9/PJN2yaS+8YVJrJrtps7PG9/9uqMFZ02VaUGm+Le6bFSDC+DeAHFx3/HKUE4EIFGWL04WTW8WYjU2EfQc1WXkJbe3uhLsyXTmVhQrSNbdXorrw7IsnqU1VPUOmmAxsTW136bXtDKZqEWO6KwChKmYlXPR3EcZlUnI= Authentication-Results: lists.denx.de; dkim=none (message not signed) header.d=none;lists.denx.de; dmarc=none action=none header.from=prevas.dk; Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) by AM0PR10MB1921.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.21; Thu, 27 May 2021 22:00:27 +0000 Received: from AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::888d:190b:b3b5:1ad2]) by AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM ([fe80::888d:190b:b3b5:1ad2%3]) with mapi id 15.20.4129.036; Thu, 27 May 2021 22:00:27 +0000 From: Rasmus Villemoes To: u-boot@lists.denx.de Cc: Stefan Roese , Tom Rini , Simon Glass , Rasmus Villemoes Subject: [PATCH v2 01/10] watchdog: wdt-uclass.c: use wdt_start() in wdt_expire_now() Date: Fri, 28 May 2021 00:00:08 +0200 Message-Id: <20210527220017.1266765-2-rasmus.villemoes@prevas.dk> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210527220017.1266765-1-rasmus.villemoes@prevas.dk> References: <20210527220017.1266765-1-rasmus.villemoes@prevas.dk> X-Originating-IP: [80.208.74.47] X-ClientProxiedBy: AS8PR04CA0198.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::23) To AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:3f::10) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from prevas-ravi.prevas.se (80.208.74.47) by AS8PR04CA0198.eurprd04.prod.outlook.com (2603:10a6:20b:2f3::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4173.20 via Frontend Transport; Thu, 27 May 2021 22:00:26 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 262d49ff-3177-4c6f-d67c-08d9215ad57b X-MS-TrafficTypeDiagnostic: AM0PR10MB1921: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TvsInbyEqKTg4MqiJdv7I+dQYeFYcIChgEK4z9Kb+XCa7e8DHM8GCNZnHZa7EI2OLB3qNYc+5hPEkSNuP2b9aHq+7kTgkRUyDzDK7F8fZ42OjUoHfzddNDShJQLqhn/hDdlA2IVTR9ss734RDU0UD9qyxacyy0kZcQ0vN/OZ4iwWT/MsiZd/MaY2qahDg6z21K2gO3XMonD4lXgTvxVtWGC0h9gCLQZoVE0giVGNBbgQO2s8z43j7o1qEpqBQHA6Mj7BYOaDTJQEknDAgE8VqmyVGHvHYZGKi4qG8dcOPqM3FEKaLH87gpIBdIa/uFJuq5+HeXpWRY+xQN9Burs8Op0GAmJji4N27wHwEpkN1Qs8qK2uyvBoZbTmDKYHSg/YyFIx89gGpKUMXFZkwqCgxhJur4bOBiINtvB9sKzRq80s8Y/QQVvBp+wnaotYYZ3u75m3eAt/NC1cgSjyGcY1O6CApP4oNfzUWuqq5zCMwQPm71XCyB/PkwkTQqCOucjSx3eTW+iU/NueCq/0p4csB40J2BJXpoXXl0wYUvYNioEdjkE1DEt8tNkA/tHyJgq1a2RlR3ycSqpgQpXlGlym3K4wL2NADXw9YW/GqMM9XzCFZLmRuAZ0NbYh9HD7F/cZxk61d1DgSK/tWHuUPlLviBjKCTv7bJecT3zXo0c2nbo= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(346002)(376002)(136003)(366004)(39830400003)(396003)(66556008)(66476007)(2906002)(8676002)(83380400001)(6916009)(1076003)(66946007)(86362001)(54906003)(36756003)(52116002)(26005)(6506007)(8976002)(38350700002)(38100700002)(4326008)(107886003)(8936002)(478600001)(4744005)(6486002)(5660300002)(44832011)(186003)(16526019)(6666004)(6512007)(2616005)(316002)(956004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: khmjAMzbdn65vZdnqi+daRgcBL63wVRJFP9OUD4EjylcBt2uUXmcOmm5J+VpvE1L0DRjjGuy6/y/GaG0ZgNJOH7XJkJchSiEV+T2NUu7WxYLotiOSYVA2MZm54uDRl7nLlMofNtScdCEvjqrEQCWTdGCF0HebrS0g5Mpu83TBCOdJf5TsSUEkOafismYk/3Ck3HGP1e6FeofPlT+wFeSSf8VAMejLYvk/NNf+DfeTtP2zpuzGeH/Kky54BOhCCNQBGWQlHQ/uI4Oju+3lTqb9h+rc9NSkf+Zx7UkALwmOx2+IZ0otJXdrNGh4BTA6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ff-3177-4c6f-d67c-08d9215ad57b X-MS-Exchange-CrossTenant-AuthSource: AM0PR10MB1874.EURPRD10.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2021 22:00:26.3591 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: d350cf71-778d-4780-88f5-071a4cb1ed61 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ck/NC+Eq9kpwvxg7UO10tr7A20kTU0RbZ9d/vmp2Y1rKNtjqyeXl1BdtlcW9Ptj5W5AIzf4qarDqunDSMqq+FQ0q+gYAPjzSSSxqd9b3ID8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR10MB1921 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean wdt_start() does the "no ->start? return -ENOSYS" check, don't open-code that in wdt_expire_now(). Also, wdt_start() maintains some global (and later some per-device) state, which would get out of sync with this direct method call - not that it matters much here since the board is supposed to reset very soon. Signed-off-by: Rasmus Villemoes Reviewed-by: Simon Glass Reviewed-by: Stefan Roese --- drivers/watchdog/wdt-uclass.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/watchdog/wdt-uclass.c b/drivers/watchdog/wdt-uclass.c index 2687135296..634428fa24 100644 --- a/drivers/watchdog/wdt-uclass.c +++ b/drivers/watchdog/wdt-uclass.c @@ -118,10 +118,8 @@ int wdt_expire_now(struct udevice *dev, ulong flags) if (ops->expire_now) { return ops->expire_now(dev, flags); } else { - if (!ops->start) - return -ENOSYS; + ret = wdt_start(dev, 1, flags); - ret = ops->start(dev, 1, flags); if (ret < 0) return ret;