From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932362AbeENNhu (ORCPT ); Mon, 14 May 2018 09:37:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:49380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932212AbeENNhr (ORCPT ); Mon, 14 May 2018 09:37:47 -0400 X-Google-Smtp-Source: AB8JxZr0AlDnqhU3ZMN6q6pRgKG84YwUSo59mmqWyPMOse2nkQgFGYBKJ4IcLUovZ1QElhEoPiAKjub2+7COrNeY2Lg= MIME-Version: 1.0 In-Reply-To: <20180511162028.20616-11-brgl@bgdev.pl> References: <20180511162028.20616-1-brgl@bgdev.pl> <20180511162028.20616-11-brgl@bgdev.pl> From: Rob Herring Date: Mon, 14 May 2018 08:37:24 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 10/12] platform/early: implement support for early platform drivers To: Bartosz Golaszewski Cc: Sekhar Nori , Kevin Hilman , David Lechner , Michael Turquette , Stephen Boyd , Arnd Bergmann , Greg Kroah-Hartman , Mark Rutland , Yoshinori Sato , Rich Felker , Andy Shevchenko , Marc Zyngier , "Rafael J . Wysocki" , Peter Rosin , Jiri Slaby , Thomas Gleixner , Daniel Lezcano , Geert Uytterhoeven , Magnus Damm , Johan Hovold , Frank Rowand , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, "open list:GENERIC INCLUDE/ASM HEADER FILES" , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 11, 2018 at 11:20 AM, Bartosz Golaszewski wrote: > From: Bartosz Golaszewski > > This introduces the core part of support for early platform drivers > and devices. > It looks like most of your prep patches are to separate the alloc and init of platform devices because you are essentially making early devices/drivers a sub-class. Maybe you could avoid doing that and simplify things a bit. Comments below based on doing that... > +/** > + * struct early_platform_driver > + * > + * @pdrv: real platform driver associated with this early platform driver > + * @list: list head for the list of early platform drivers > + * @early_probe: early probe callback > + */ > +struct early_platform_driver { > + struct platform_driver pdrv; > + struct list_head list; Couldn't you use an existing list in driver_private until you move over to the normal bus infra. > + int (*early_probe)(struct platform_device *); Just add this to platform_driver. > +}; > + > +/** > + * struct early_platform_device > + * > + * @pdev: real platform device associated with this early platform device > + * @list: list head for the list of early platform devices > + * @deferred: true if this device's early probe was deferred > + * @deferred_drv: early platform driver with which this device was matched > + */ > +struct early_platform_device { > + struct platform_device pdev; > + struct list_head list; Use a list in device_private? > + bool deferred; > + struct early_platform_driver *deferred_drv; Can't you use the existing deferred probe list? Rob