lkml.org 
[lkml]   [2015]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v9 06/17] h8300: CPU depend helpers
Date
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



\
 
 \ /
  Last update: 2015-04-27 11:21    [W:0.306 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site