Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514AbbD0Iyl (ORCPT ); Mon, 27 Apr 2015 04:54:41 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:54803 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752880AbbD0Iyg (ORCPT ); Mon, 27 Apr 2015 04:54:36 -0400 From: Arnd Bergmann To: Yoshinori Sato Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org Subject: Re: [PATCH v9 06/17] h8300: CPU depend helpers Date: Mon, 27 Apr 2015 10:54:24 +0200 Message-ID: <6023810.QeChDcReGk@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1430112924-1134-7-git-send-email-ysato@users.sourceforge.jp> References: <1430112924-1134-1-git-send-email-ysato@users.sourceforge.jp> <1430112924-1134-7-git-send-email-ysato@users.sourceforge.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:J2UJbpsdVUtVMYM578kUFyGU6KHD/dN7rqaJYLRI20Ip1V8UoHG nl2uf+9GwCw9OaO131BEezPlEK90kCOWOfg0bDKaxPU0CnELMm5OSbcu678yALDACM/x+Nk sBd9kPPA1MHI6Xl2283oDK08z72a0SDMzY2IL+LdHgEkuPdPqgy/1HBrfbGwsGN6eMZMX60 pcNJ6pmrBTM51TOt2iZJQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1839 Lines: 54 On Monday 27 April 2015 14:35:13 Yoshinori Sato wrote: > +static struct platform_device sci0_device = { > + .name = "sh-sci", > + .id = 0, > + .resource = sci0_resources, > + .num_resources = ARRAY_SIZE(sci0_resources), > + .dev = { > + .platform_data = &sci0_platform_data, > + }, > +}; > + > +static struct platform_device sci1_device = { > + .name = "sh-sci", > + .id = 1, > + .resource = sci1_resources, > + .num_resources = ARRAY_SIZE(sci1_resources), > + .dev = { > + .platform_data = &sci1_platform_data, > + }, > +}; You should generally not define 'platform_device' structure statically. Generally, all new architectures should pass a dtb blob from the boot loader that contains the device definitions outside of the kernel binary. If you don't expect to use h8300 with a lot of external peripherals, you can also use platform_device_register_simple() and related functions to register the platform device here, which lets you remove the static definition. > +void __init early_device_init(void) > +{ > + early_platform_add_devices(early_devices, > + ARRAY_SIZE(early_devices)); > +} I would like to eventually remove the early_platform_add_devices() interface, and use some other mechanism here. Can you try either using devicetree to probe those devices like ARM does, or just calling into the drivers manually? In case of the sci, using the new 'earlycon' framework is probably the best idea, and for the timer, just call the probe() function directly instead of going through the whole early_platform_add_devices and early_platform_driver_probe() dance. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/