lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 27 Apr 2015 10:54:24 +0200
From:	Arnd Bergmann <arnd@...db.de>
To:	Yoshinori Sato <ysato@...rs.sourceforge.jp>
Cc:	linux-kernel@...r.kernel.org, linux-arch@...r.kernel.org
Subject: Re: [PATCH v9 06/17] h8300: CPU depend helpers

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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ