Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp690443rwl; Fri, 7 Apr 2023 04:03:44 -0700 (PDT) X-Google-Smtp-Source: AKy350YlFlh3S97z1KWwVGb5CfEApA2A446gjS7sa9mCs1TrEGESpCRf+DVH4LwdlZzxGnQzBzF+ X-Received: by 2002:aa7:9739:0:b0:626:1523:b10d with SMTP id k25-20020aa79739000000b006261523b10dmr2209639pfg.4.1680865423745; Fri, 07 Apr 2023 04:03:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680865423; cv=none; d=google.com; s=arc-20160816; b=ILckHGaQ545aybq9CmiG6ZdfD1tNMuMJRTM780EIXRJ0P9WV03r4Lbk8cjVtaBwUYO YCRFgGalHa92CNQ4Kp80DHEFhILP4nST8LjqG5JwmYUu2nCNNUUJ+ObDyQAfXGCzPmZT 8VmZqUjgQNmUqVci+5OpbSDjWXfRQHeaxpV2cg53b2ZYYsx3vM+HDiYjlW+OQdp/bdrD Epzr0YaTz4/tTi9xFjK3KfUdVUo6mVh0vdg8APnHedAT1yv93IlSalrmazxc7y2d20A6 WZRP/M2QhxSCrcJRfHW7t043lN5ZUxmZXCtyjzVmnF/Vsl8cN5szAQDUWUqjYVAehyji /XJQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ZzVQzob6w+uGiqMm+prIjkfjAtxo6cGiHRkUXlkvJQE=; b=lUVugPP7ttQhW0aLd4girfQl4fTlSOB0o4ScFmesD8cC+ZCzUX/1RpHHzaLMKUTkpU LRA/k3rq3XFLz+sGkiHXG8WOiuQNTVSG8I8GD1veHVWH40Ip8gq/n/DDt0w1CopwZ3uk NrRHDMoA0YAOV5p2SKrQsh4qV8Fev9atZnIYnmmnGMwhArhsLk70vByWgBqaCFg5abx4 vtj2UE5sM4b1WuoHVxJkmyP5Oy1tNDv2X9h8y9Y2zhFU36UmjSGS3kANG/9XAijEzPyh FAd377f1BnG4ZbZdAKhcq99niNEtGjj2Ea0JYbxTrE319AszdKmq8ThIegRL61djyRHx 2ZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="TX/X/r2m"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b65-20020a621b44000000b0062ae6345c69si3423587pfb.388.2023.04.07.04.03.19; Fri, 07 Apr 2023 04:03:43 -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=@gmail.com header.s=20210112 header.b="TX/X/r2m"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233289AbjDGLBI (ORCPT + 99 others); Fri, 7 Apr 2023 07:01:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235110AbjDGLBB (ORCPT ); Fri, 7 Apr 2023 07:01:01 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C16F859D8; Fri, 7 Apr 2023 04:00:55 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id h12-20020a17090aea8c00b0023d1311fab3so43035742pjz.1; Fri, 07 Apr 2023 04:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680865254; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZzVQzob6w+uGiqMm+prIjkfjAtxo6cGiHRkUXlkvJQE=; b=TX/X/r2mQwqCY10LHjcYSXqp/+x3G7pptxPF/QLR8hauClknYFW0K+kRtmlUVEkDdv MTAkK9WsuKZZGnrU9/P8a3AUyA9LH2nw9RjZ2Dc3mDVMQUVDaXXkppNOI4iL3iGDmhLN JV1nfbFR5RVfGPbUSBvIjJYiXpP9vggrmOnpKwMD9YxKZzQwIP5+NNobcmLgzfvO1TXo 94vLS1Ks6kDqqMVEi9UWlfr56I/ERFgYj7egswrd9ffbcttBr3w15jN8tLVBDRVsOUdY XekU2Ow24gw2Vi9gqANXDwCXaeYRBaZZ3Pm7dhLJFBCWRf3cs7qQrU4yNdMuSXuVaH6/ iROg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680865254; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZzVQzob6w+uGiqMm+prIjkfjAtxo6cGiHRkUXlkvJQE=; b=1nP1xEPLodUhavr12Kh+/kMNRAjhq+fR63n472aqTOq2BNQukqHx+lrqA0SiNQIwvb Zn6iXsTZ+9w5K3DIzHAre80Yd8ngQfF/qWntVQT9MGdUdeBvQ0UshulRpuBmR1iAqyxW FmzLDteftDOWYJ5JDaFvKf8DEBCbM/glYI6JXXlNRMkVl4m0Qkna6OwtxM7Pv8zJe9M2 l08xEJsCPsbEve3LGUNa6UhK10TgluZtujbgaXfsE49g9kn3060KUha+/5LZWRc1lozH 3Rx2yT0l3WC0ebCxJBxE9WR9vtmlPWxIFwjJxuHr0MbY7ol4hNlCJ8iLjySTnuyrIcuU hbrQ== X-Gm-Message-State: AAQBX9dLzs2W1zx62nedDF2cypyYAUh5PGtrpTOOlT95sZCM0Hsw5l8j BfzLFreJMYitQ0TjO08DyEf6LfBk6q5wCQ== X-Received: by 2002:a17:902:f541:b0:1a1:d366:b085 with SMTP id h1-20020a170902f54100b001a1d366b085mr3069596plf.21.1680865254264; Fri, 07 Apr 2023 04:00:54 -0700 (PDT) Received: from kelvin-ThinkPad-L14-Gen-1.. ([38.84.161.179]) by smtp.gmail.com with ESMTPSA id jw1-20020a170903278100b0019ee042602bsm2732005plb.92.2023.04.07.04.00.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Apr 2023 04:00:53 -0700 (PDT) From: Keguang Zhang To: linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wim Van Sebroeck , Guenter Roeck , Rob Herring , Krzysztof Kozlowski , Yang Ling , Keguang Zhang Subject: [PATCH 2/2] watchdog: loongson1_wdt: Add DT support Date: Fri, 7 Apr 2023 19:00:25 +0800 Message-Id: <20230407110025.516405-3-keguang.zhang@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230407110025.516405-1-keguang.zhang@gmail.com> References: <20230407110025.516405-1-keguang.zhang@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds the of_match_table to enable DT support of Loongson-1 watchdog driver. And modify the parameter of devm_clk_get() accordingly. Signed-off-by: Keguang Zhang --- drivers/watchdog/loongson1_wdt.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/watchdog/loongson1_wdt.c b/drivers/watchdog/loongson1_wdt.c index bb3d075c0633..c2694222ea86 100644 --- a/drivers/watchdog/loongson1_wdt.c +++ b/drivers/watchdog/loongson1_wdt.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -100,7 +101,7 @@ static int ls1x_wdt_probe(struct platform_device *pdev) if (IS_ERR(drvdata->base)) return PTR_ERR(drvdata->base); - drvdata->clk = devm_clk_get(dev, pdev->name); + drvdata->clk = devm_clk_get(dev, NULL); if (IS_ERR(drvdata->clk)) return PTR_ERR(drvdata->clk); @@ -142,10 +143,19 @@ static int ls1x_wdt_probe(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id ls1x_wdt_dt_ids[] = { + { .compatible = "loongson,ls1x-wdt", }, + { /* sentinel */ } +}; +MODULE_DEVICE_TABLE(of, ls1x_wdt_dt_ids); +#endif + static struct platform_driver ls1x_wdt_driver = { .probe = ls1x_wdt_probe, .driver = { .name = "ls1x-wdt", + .of_match_table = ls1x_wdt_dt_ids, }, }; -- 2.34.1