Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5406781ybg; Tue, 22 Oct 2019 02:47:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwF6VISjxGJJIbx9eRv945Ub+Wb5rysNTEPavYZQg58S3bUV4G/qBZdJElNh5IAnEhn7c9v X-Received: by 2002:a50:b966:: with SMTP id m93mr29548890ede.228.1571737632838; Tue, 22 Oct 2019 02:47:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571737632; cv=none; d=google.com; s=arc-20160816; b=sxxXkKdgB61Cmvpjg0vNBEtk0TgRw1u+W2zuG7ZT7Q0Gykhrn4V4Upa7/huTh/+QFo 05DLRgRAD3S2f6BQqDKRTHSivHMTarZRZWLkWVt1dJnjdrlHmnpAwqLqCSVKV3bBgPhh Cdfx8kYEg1ySbbBWbRAXhSq3ZXIYG8/c3bcGn/NgTNN7Z+oNHY2KzHjPEJdHRHnn/0Lh xLuEwsIDxmxVNf9+9HJDCcs4x9I4X1uylxE1M8QefPOh4Xdv/1c/PQ2dHcvdElC1U6De Csv8kJ0O5b//hZzpDMwqvDTHtHXFky2X3lv1K+0VPttU0OZZ8n9GGBoSxA27C1inIO0r aVQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=rMgBHpbFMClX7P4//KibFzh/dlt9QimaMY1ti4WtBuM=; b=y+2O+03FGzy08dYDcO1DOdcXX+FzAtv5TjI+G08QJxQC7VzRfxRM+reN3Ego87HxHo Tr5heL8k8jCCYdK3ICuo6qq2pqExITXCAFDcvrFczav5fuzn7iiBpRkj2kvgWZwKdMbB hdgiaNn/pXlTgUZAjTlnKu1U24ZbNar07X8hPgrkMVogTC0fjNY7iPd0HU8Nr03Yqf89 eQx7dO30iSiDZANknN7P7nJtz3BM+3Nnh1l/7KPU+RXBEsAZ+HbF349FPgynMCME4HXL PexbihwmQrZ6fZc3VXMx+0yq2J4EDPrvqCir5KfU6xNeXUjf2UFaR8I34bTxn+U6XUTw giKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca4si10819909ejb.39.2019.10.22.02.46.48; Tue, 22 Oct 2019 02:47:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731470AbfJVJox (ORCPT + 99 others); Tue, 22 Oct 2019 05:44:53 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:37195 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730619AbfJVJox (ORCPT ); Tue, 22 Oct 2019 05:44:53 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPSA (Nemesis) id 1MvbJw-1i3O5t0uak-00shqz; Tue, 22 Oct 2019 11:44:51 +0200 Received: by mail-qt1-f182.google.com with SMTP id g50so11627486qtb.4; Tue, 22 Oct 2019 02:44:50 -0700 (PDT) X-Gm-Message-State: APjAAAUYazSrb3Gwxzn0uEB3Xz5IMLC0WgvMwk7I4JMHZW04/8eMzKLu W4MQVyD5axg4khHD1E6zxkhNUOv0cr+r8Paz+Ac= 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 Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Linus Walleij , Wim Van Sebroeck , "linux-kernel@vger.kernel.org" , Linux ARM , LINUXWATCHDOG Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:TFMiph9iftlPu/I44aOxHFyNWGsYwv4B00XFAtCQdCQRjaJURuI WX3mqNCkEyiZ/JXLGJMfVD2K6/mNI/4Kp3o7KbRltUNfdCUY+x50VGtyfLlj7bqO/v4o93X wmjeQNiEUltJb7EnUQ1Xqzjn+IwKH2I+4D9dNGrx7t+wCtU0GbQkwDSn/9f7ysqT1ShUigM zk3J1dG3cPxUhD0KspWFg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:X4jd4H54yL8=:goNIci1sGhaZ5snOezD3LY SDY3Vqyab26QqB+uY3lw810jl/gAFyJHlvKxaNWlSA7igpniuHPPD7S/GmE0QHFbHD423zPu8 gSauNQUlolz55d6vRVdALJc+ox59ZxB3MLAGv8gXwqBn+h/w3AQPDWCrVyLIISFmPNQPnw7j1 4l9ILrEPg36GR38AS/4DUhpXeFvMDOZEVpYsaxzNUlDRXWhmxRwrUqmW34vt51Iukk9lZhGg4 9wNyu0SRtSLK0RevCxH4r3T1ndkOvwhJ3xs3P/4vMG7GLn8n5yHbi6/wzXvznl+SrpJxihfns 90xoTMDm68xxfVZB264HjxWQdHMRSkiNwyoeUGNVWusRlK0kJaZz9ANTiVgWxtGbUkkNZMpFF b8zTOFcrgAUcO3KpK32UCBlfYxAYi/WhSX9zOV7dFCVWhYke9XOMvDlkVAKuzttotrChooPRB 0e8SIJGLyc8KrzLjCkmaXbqZJ2apuNDkqH9ZH6lVFYMOvgNMExLghjb2SyJhZreSzKQ43+943 vRVErfeXavgvoQDvN9HfFCeID1f5tE1+xa51xnpDhlbZzIQSIwRMfsizRBdPD3T3b2WjbQSvq AsKnb5mv6pVNCRyf0hO4NPWoqvepcsNyaoAxKJ34QWpZe25NSrnc6pCUqS7mQ+KxOlxfy1hAB 8jJxpMaToEIcyOY/ZrkM8upYGjzcPjrfxocpKwiOSE/WVmNJErNZbItO+qlOsWAkv4uqAZgz7 VSXZGADqkApGbl97oTPPbuHoz/uapRr4aLBfat5jAPE7pP64NXVOhyO0Kk26Sc3WyGNLTI2xF Rnk3wC3pHUu56QEyn6mSpt76gtasSA+krT0xQ5czQagDsca+KWZTp8XIQ2kMj42k7eQq2MRrq HS8tKj6Njt8EnNW4nMNg== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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