Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp5692998ybg; Tue, 22 Oct 2019 07:05:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzH2YWsIeLJ17sg3z+aJixjzmvs9WiUUtgdi2YwWXR6e2F0tgGxcVrxknkz4szIV9a7pP1Y X-Received: by 2002:a17:906:2989:: with SMTP id x9mr5474030eje.318.1571753134447; Tue, 22 Oct 2019 07:05:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571753134; cv=none; d=google.com; s=arc-20160816; b=WOkM84S+YXnaXASr20HDaaCCjpPjr03AgB0uDowwHmGTcrF7tmV0yHIgxoFnnDwPlh lo9S2mDDQJcD8cZn1wC2tOusJN+gpsoT34Xw83U/reZtanv+OWSbgOZqymWehhKEeldE MiLkYGKQKeT75vcp9izFFKh8ELgsizn9XsYkibDIK25SAsrAyt4wSEVvHXh3+c2fB9JW ySyWEm2alXxr3s5SxYHY9qustFclsOEHvAYeb+gRV4g4J75XVgtDZLFcO9JMvl7w/ZwV 3SQwr+Kq7UbWyFX6kGzBjSSxydtmSXEL3lYTuqVXhoP8Jgn3l5EFa2ZjqADlNRWNW4V6 B9bA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=gpoW/8Yw0CDfvnTYDUEt7wnlvPB+LdjenekF+dbtjls=; b=0RdllD5TvHfvEbwe/hqBZ9miEfDIBPtQQDhwGtScNypQKsJLEo1FZjWFe7cm9qOnIZ oHbQgSwoQyFkMDroJ5SPmWne8CeMX68Di8SHNrBNZumjZa40wt/Fa61lvl/GYBnpg30h iWK23vg2Q82rym4TdGpbP5g6VPajZMLDF2W1ynvtUDwKNWeBRsLuPCOS2rMk1JmVqQfL XJf94QjeVH6cOgL1xR88Z7D3mY8swc2+WBufgSXeIicDTCnl6aJ9WaLm1VoENw1DoQC/ aZGhJ+x9lrPGxa1K46r5JbfR1KlVn3suN1PaP3deX1sFj9OqiuqMy7V0Uwt3SEttz00j /8FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=r3lN2fcN; 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 t49si12964055edd.198.2019.10.22.07.05.08; Tue, 22 Oct 2019 07:05:34 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=r3lN2fcN; 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 S2388416AbfJVNjB (ORCPT + 99 others); Tue, 22 Oct 2019 09:39:01 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:37650 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388106AbfJVNjB (ORCPT ); Tue, 22 Oct 2019 09:39:01 -0400 Received: by mail-pl1-f194.google.com with SMTP id u20so8382880plq.4; Tue, 22 Oct 2019 06:39:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gpoW/8Yw0CDfvnTYDUEt7wnlvPB+LdjenekF+dbtjls=; b=r3lN2fcNiqbiD+lTtxMThvS7h5kEpehwJT2wWH9MYxpdx0zW6ZvPe5+oJTGHBdo3UJ +1snUlb5BmZKfZgCMc5oHa9QCVpM51bJtLcoi0n8l6jvNxfYgPFgQ3xMC4wejMQvvNYf FLjLePAA2nsc9FCaZLwszr/yv2z8Vo+c37bA8ZqlWGieYmxcCBCFDjIlAayEvRnKlNTe rqo/FUiZITczTRPc6fHUG/C01orY7LXqFnZKXsZ7XIBhPyrITrbCxMUTxVQfktXKt10E YtnLrgW/UV4XeUX78ycvlYJllBR+2c+GHpwybsbZFCsZd91dCUD8z8jlNuKghFtR7G86 EPSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gpoW/8Yw0CDfvnTYDUEt7wnlvPB+LdjenekF+dbtjls=; b=AUGwPbPwoXLPDAYRjGmvwEPtzEdlSMz3iixGNDBdffY14Bi4wUIbqjQVkZb+MW2Dzk lkaYNEU1PAg7JXfLhqtSxpgy50m3BYm91sXSrFlfDcLtkE9z/3snsi3oxE7RUfVS3jiZ 2He8/I71I8HKs/X3cYXFPDEOGU8tvN/atLosaXz7C15H9nLls2bJZujJ8sEAN/aGmMK8 5RTn98PlYEFXTyUl0XSAjqbejd5faNhyRjYPbI63iyNE3uMWcHTKpz6D4jPYdAVcfk4S gEBHFQZAep+AssdqbSVN03mFZNOo8bIZvlDBOmPGwV6JzKJMvEtyQRCgeSFCH/lGL3F/ cMzQ== X-Gm-Message-State: APjAAAUrrK+mNU/wp0Gzzbgba7og3kSx9snAMFD9L2p52dxpA6OTbB/n SlqP5qFYY8Jmw9A1NWuxMqtQhCOu X-Received: by 2002:a17:902:d90f:: with SMTP id c15mr3753482plz.157.1571751540152; Tue, 22 Oct 2019 06:39:00 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id f188sm22206087pfa.170.2019.10.22.06.38.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Oct 2019 06:38:59 -0700 (PDT) Subject: Re: [PATCH 09/46] watchdog: sa1100: use platform device registration To: Arnd Bergmann Cc: Daniel Mack , Haojian Zhuang , Robert Jarzmik , Linus Walleij , Wim Van Sebroeck , "linux-kernel@vger.kernel.org" , Linux ARM , LINUXWATCHDOG References: <20191018154052.1276506-1-arnd@arndb.de> <20191018154201.1276638-9-arnd@arndb.de> From: Guenter Roeck Message-ID: <21d72661-a4f1-d51f-ddf0-f8cebb984029@roeck-us.net> Date: Tue, 22 Oct 2019 06:38:57 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/22/19 2:44 AM, Arnd Bergmann wrote: > 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. > No, I was just wondering. Thanks for the explanation. Guenter