Received: by 10.192.165.148 with SMTP id m20csp1073334imm; Fri, 27 Apr 2018 12:10:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpYuBXi5gAmOWm91aU1gwRONxjaMxO7GUAQeEClTkKanPf4Lj3lL9GCU2zttI5eGOGMTP0u X-Received: by 10.98.233.3 with SMTP id j3mr368568pfh.196.1524856226139; Fri, 27 Apr 2018 12:10:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524856226; cv=none; d=google.com; s=arc-20160816; b=JJ7G1AZVGPy2Q89Oiwsrerm5fNCVNtf9zc1Bm5Gazeod8m07T0orxAhfvmKBwCiGdr NDW8Pvtenx/Y0etECWBTxIJHftVABFp6SCXzs82j5OTCOOehAEh4KUem/Z85e6z+jSnm mtWw9C1k0JW8ABFHzo2h59JT972P/PZdQjWbQn6NfLRPqMXGIXy0Z1l2/K1e+LaCEmCv Fve8HleTbK+xXQwqb3oW8L8RDbzVmmG3tCoNGRAT5NceNvs+HjzQY0pOopBY2nqMVTzG Kk2bv5LH6h0BLRI/aZNt2K9bgeHO+V86OBOQdPYOjBHJENIJ8wrOVbd2GUw0JgqgsG1g H8AA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=PnrzaKIGLJAKnE+8crZA1Ez0JRu7eiK8Kvow6RfhS+k=; b=EPjjd1ff597X4QdWHbTCGFmsxvZvqYWxw/iwYK97u7AEJWb0pQH74K7fl6C+AnQMeL LK5slk71Bk5SqtgfP37YAFmyocS0zkOse49I8Mpd+95wlv5L4QzN5CO2bZcD7/kcclSg IQz8jlDB7v/MYOWtgkRxfcIAH1s/C2jChAmHlwebQZDU1yy9Bdp0TMtcRoD7WzG6Fsqh aoJxq1PqDO+4QRHzCy3xGXdacDPnPZjatqQRfAquork7SUzIeOXzOwzAAMSa9+0hOljy BNX1QWA4xwmmdwXb++0MJ5CQPCe2Nt4ZPtLR2DIo5y6vDBMJJF7zH/HyTBnrArltHOcB Vn2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=rDnrcL9z; 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 71-v6si1767500plb.511.2018.04.27.12.10.12; Fri, 27 Apr 2018 12:10:26 -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=rDnrcL9z; 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 S932662AbeD0TI6 (ORCPT + 99 others); Fri, 27 Apr 2018 15:08:58 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:40513 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932609AbeD0TIz (ORCPT ); Fri, 27 Apr 2018 15:08:55 -0400 Received: by mail-qk0-f194.google.com with SMTP id h138so1477353qke.7; Fri, 27 Apr 2018 12:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=PnrzaKIGLJAKnE+8crZA1Ez0JRu7eiK8Kvow6RfhS+k=; b=rDnrcL9z+5JOWht/45L8HSGvupct6pSMOL+VYbBiJ/MYy5ws3Z387xo2ywySvwoG1M 0DTD3aNKd8VZ/tQGMXAn6WDEu5wglpJjVOutluw4uQEXQFzapm2izWZeFgWCcXUqkzsj JNdl+I8+F0uZ5JfC4gInRsFVgg3QwdFb1uBH6h3USXVdl7TU5xUgtTHTnNQoTqorwviT fQDe/RXDEMG3vZCY7oppIrVN9CkWavwTi5vsorV4s9r106ex2yuHi3x4n2nLypyQtPls 3uI6BHvXeDfP1dP8Acu5IshzcaxDebzY+cu1FFDktz8URFqlMY+OGq5qxzNcPejSRI5U /iPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=PnrzaKIGLJAKnE+8crZA1Ez0JRu7eiK8Kvow6RfhS+k=; b=cwtEMIw5L08ihASOO9zcZbOV2knssrfYgojCTk/0AtlGAJMa4w7s2h1fo2tEiQgTBs D3GLOoivI1ntgS6adXqT0pSwmFTV1rYC1FmYlBf9JkoKX/VKBjth39/dWDJ5qKs7YnCF gjcy9bGi9Z69K0zitjSYfTvDq+G9Bd0b5hjQfznCY2ADP3mZKR1YkddYPRe/vkH+Rvnk Vb9atr+KU27EOc4RsyMts0QmJwAJnc0PRyWC8KqZOTZ2U0pD4NnWsLRqyge3/B69OrUO WTpvgQyfPrlGh9139gDAiwCnGjoTEyMo3X3o0QeIwNpjPsiAYr/ezV9mV55A0VTR8HMW 5yfg== X-Gm-Message-State: ALQs6tCQ0qPbrpy/lyzKkUkS3tYubRTLV/7Gca3/70Gjn1nHinX4l/2u E30VHms/lABYP7Rk6dswxYmMdFb7hzVNeRo0cBs= X-Received: by 10.55.149.70 with SMTP id x67mr2944317qkd.202.1524856134467; Fri, 27 Apr 2018 12:08:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.185.3 with HTTP; Fri, 27 Apr 2018 12:08:53 -0700 (PDT) In-Reply-To: References: <20180426152920.21569-1-brgl@bgdev.pl> <20180426173151.GJ3094@brightrain.aerifal.cx> <6d1f9114-f1d1-961f-4f36-74adff059dc3@lechnology.com> From: Arnd Bergmann Date: Fri, 27 Apr 2018 21:08:53 +0200 X-Google-Sender-Auth: 9ANiWA44--KN7taU2CHi5eNeMNY Message-ID: Subject: Re: [PATCH RFC PoC 0/2] platform: different approach to early platform drivers To: Bartosz Golaszewski Cc: Bartosz Golaszewski , David Lechner , Rich Felker , Sekhar Nori , Kevin Hilman , Michael Turquette , Stephen Boyd , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Yoshinori Sato , Frank Rowand , "Rafael J . Wysocki" , Jarkko Sakkinen , Dmitry Torokhov , Arend van Spriel , Heikki Krogerus , Michal Suchanek , Jan Kiszka , Andy Shevchenko , Marc Zyngier , Peter Rosin , Linux ARM , Linux Kernel Mailing List , DTML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 27, 2018 at 6:05 PM, Bartosz Golaszewski wrote: > 2018-04-27 16:48 GMT+02:00 Arnd Bergmann : >> On Fri, Apr 27, 2018 at 4:05 PM, Bartosz Golaszewski > > So speaking in pseudo-C we basically have two ways for an imaginary > future timer driver: > > int foo_probe(struct platform_device *pdev) > { > struct clk *clk; > > if (probing_early(pdev)) { > clk = devm_clk_get(dev, "earlyclock"); > > /* Do early stuff. */ > return 0; > } > > /* Do late stuff. */ > > return 0; > } > > --- vs --- > > int foo_probe(struct platform_device *pdev) > { > /* Do late stuff. */ > > return 0; > } > > static int foo_init(struct device_node *np) > { > struct clk *clk; > struct device *dev = device_from_device_node(np); > > /* Do early stuff. */ > clk = devm_clk_get(dev, "earlyclock"); > > return 0; > } > > TIMER_OF_DECLARE(foo, "bar,foo", foo_init); > > I still believe the first approach is easier to implement and has the > added benefit of supporting board files. Right. I still like the second approach better, since it avoids multiplexing two very different code paths into a single function, and because it's closer to what everyone is used to at the moment. Prototyping both is probably helpful to get a better idea of the actual complexity this introduces. > I'll give it a thought and will be back at it next week. Ok. I'll be on vacation for three weeks so I wont' be able to reply on the new patches. Arnd