From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEA7BCA9EA0 for ; Tue, 22 Oct 2019 09:45:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90AB52084B for ; Tue, 22 Oct 2019 09:45:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cRlGj8aN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90AB52084B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LdPH2ng+/zTDKtNrqCBETHLnOqTYde+mVXfmtOpL4SU=; b=cRlGj8aNWRBXgx t3TLFxhxh/6fcHEREJ5oc99uVDlZpo2XEKN6QnMFEQCGS/JE5jMxvXLOgyQqieVYf5ePqhMFPL2mh VR0avspLz/2msfmjH8DKRjpjTGvaWakSsP80LOAh9968/9cPxPKHvbu5zeXgTD2A18JtHsTcgtIBh lpNT7eG5QkDqAqWO/NoUhsvr0hENnHr77Qpsszd0yqmBcCG3aWusUBwcX9Gh4xqQP8+JluTJ11Xo2 MT0nv6DC45aZqKJ4FMjOBWVvyUZ/YzHxLeMhVo73jhbNe2QtupSZ5+QX8jsGhrYCMQ7bbZ8KWTD2b kDgTbmu3nomHHCdt+2aQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMqip-0004Yb-VH; Tue, 22 Oct 2019 09:44:59 +0000 Received: from mout.kundenserver.de ([217.72.192.75]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iMqim-0004Xp-0W for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2019 09:44:57 +0000 Received: from mail-qt1-f169.google.com ([209.85.160.169]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPSA (Nemesis) id 1M5fQq-1iOVPV1gUs-007CPm for ; Tue, 22 Oct 2019 11:44:51 +0200 Received: by mail-qt1-f169.google.com with SMTP id t20so25764047qtr.10 for ; Tue, 22 Oct 2019 02:44:50 -0700 (PDT) X-Gm-Message-State: APjAAAW7JbPfWTcQg2bsUFIbmKVFL6/vECqbFclAGpcQvg2I71uvf8qY HgCN4aXv3IyFBlrgnW2p1rPnWaTWlrGm3xGet0Y= X-Google-Smtp-Source: APXvYqxUguCPOp5LGMrfhG+G2UL8MgJST6yvwsbwS5pSbXnjYf7SsBUo3nYRm7EHYr0oSYA+LoNeUI92RIaCIkpSbmY= X-Received: by 2002:ac8:18eb:: with SMTP id o40mr2367412qtk.304.1571737490006; Tue, 22 Oct 2019 02:44:50 -0700 (PDT) MIME-Version: 1.0 References: <20191018154052.1276506-1-arnd@arndb.de> <20191018154201.1276638-9-arnd@arndb.de> In-Reply-To: From: Arnd Bergmann Date: Tue, 22 Oct 2019 11:44:33 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 09/46] watchdog: sa1100: use platform device registration To: Guenter Roeck X-Provags-ID: V03:K1:63Fa3NslVgC7CRuCZH5eXimympf+oArix8CuaSPvsoSttRhJooS irXbm3Ea45NVbecC9D/EWZzEbaa7iyClkTiGPJPk9kT5bbHm+nJtEZ0vMNrbYK3o4mh4Vlq f5u9wQp6xNivsixeYwCFjco5zWn+l9rqSzINHGE/8eFl9r+pIJPuPkSGvciCJyGiQ0NIL3x QKlhrGtQ9RUB2e4JHsghA== X-UI-Out-Filterresults: notjunk:1;V03:K0:FrszP12h4Ms=:V+PpPXTKdG8hvJdzMEhq0K CD2kdbGWu4RZk8JvM+Leoq+luabHaBlcZ26Yaobd4fscz9pGqCaGAoguvVIY6Wsae8Ayr5SVi qKy2kBps8nBLVTwnX5K3Ubb+eApHFHi/0RXJrJQkIHwEigb4apfBRl2FIv+s2BbTENmHQetjS MaqH/8GbuyUs2yT0foQs2/rnOS9MNGfHOYPGcVqmjlRdDwm+wmILw8Pc5xZJJkzyMoD//nRfQ j3jDI4NjpYVeDfY78oYDfNJUWE/pYZmfD3UJaj2DYCihlEkoAEWGZfXM7AwnuvFQDEKyA+Z3S 2LzOh61Ok4xuyLDfpzzLcA9q47XcXdo5RFO+z4jlDjMeCY0eLu9BN388aw4k1+jfaKJ7dHJU/ 9USGKxyYemc4M6YC4m+fPniLc3P7jx444HfuOm7XlhQQX9QPulQ0+tR5MafT+b+FLfQ9tPpuc CNDyJQTb0QZq4avLdtNq9GNMFAe3d3+9S3zlP0LzGOfpV14xKo/DQW/z923YGhYSb4wwCUDgS SHJzmojqU3sAJLHVb3iisRGgoXBDzfAyODo+khFL0/2k+lk7kq3Vikl73gnrkYSlNbaPkOyCp h0/xEs6SErKtErj0eWMrXtGwuNw4KZT5WzL3LiEPv70cmQiixetfcJApV2HlH4Wyo1+QAZY2L KKkeiJRd1GCu2e9zaMy8OW+nGYTr3UrEJpglkFeDhHydThUmlYgywng5l0joJxhxismhYEDAp PeA59nZ4BD0pkJbEhl0AV2VLN7cDOzUmZzrXcRWxtV661wZ7DWGjdGY5HB8Gz6CXNDEIcRCqu OdxvGDhv6wK7fXoZzN3zjRXaiT4ftAZQ1isttBa+PgtJB3czW9qSGyVdVGxtSsVcPMym0ZmBG iJOn6shwQ4Tvc2QrJJng== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191022_024456_350790_16C6DB5A X-CRM114-Status: GOOD ( 14.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: LINUXWATCHDOG , Linus Walleij , "linux-kernel@vger.kernel.org" , Haojian Zhuang , Linux ARM , Wim Van Sebroeck , Robert Jarzmik , Daniel Mack Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sat, Oct 19, 2019 at 4:07 PM Guenter Roeck wrote: > > @@ -319,10 +316,13 @@ static struct platform_device *sa11x0_devices[] __initdata = { > > > > static int __init sa1100_init(void) > > { > > + struct resource wdt_res = DEFINE_RES_MEM(0x90000000, 0x20); > > pm_power_off = sa1100_power_off; > > > > regulator_has_full_constraints(); > > > > + platform_device_register_simple("sa1100_wdt", -1, &wdt_res, 1); > > + > > return platform_add_devices(sa11x0_devices, ARRAY_SIZE(sa11x0_devices)); > > Wouldn't it be better to add the watchdog device to sa11x0_devices ? Generally speaking, platform_device_register_simple() is better than platform_add_devices(), it does the same thing with fewer source lines and smaller object code, and it doesn't have the problem of lifetime rules for statically allocated reference-counted devices. One day we may want to replace all static platform_device instances with platform_device_info instead, but right now there are too many of those. I can change this one to a platform_device for consistency though if you think it's worth it. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel