From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-dev@ozlabs•org
Cc: sl@powerlinux•fr, Philippe Lachenal <philippe.lachenal@hotmail•fr>
Subject: Re: MPC8349ea Random Device Generator driver
Date: Wed, 6 Jun 2007 16:15:10 +0200 [thread overview]
Message-ID: <200706061615.11380.arnd@arndb.de> (raw)
In-Reply-To: <BAY122-F18923A7AA6D3A4D96A360085200@phx.gbl>
On Tuesday 05 June 2007, Philippe Lachenal wrote:
> I've made a driver for the MPC8349ea Random Device Generator, and I=20
> therefore submit it to your impartial judgment.. ;)
Looks good from the point of integration into the driver framework.
I can't judge the hwrng specific parts, but don't see anything
fundamentally wrong there.
> +static int __init mpc834x_itx_declare_of_platform_devices(void)
> +{
> +=A0=A0=A0=A0=A0=A0=A0if (!machine_is(mpc834x_itx)){
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0printk("__init mpc834x_itx_=
declare_of_platform_devices error\n");
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return 0;
> +=A0=A0=A0=A0=A0=A0=A0}
I would think that it's not strictly an error to be running on some other
hardware than yours ;-)
Just remove the printk here.
> +=A0=A0=A0=A0=A0=A0=A0err =3D of_address_to_resource(rng_np, 0, &res);
> +=A0=A0=A0=A0=A0=A0=A0if (err)
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0return -ENODEV;=A0
> +=A0=A0=A0=A0=A0=A0=A0rng_regs =3D ioremap(res.start, (res.end - res.star=
t));
This can be done in one step with the new 'of_iomap' function.
> +=A0=A0=A0=A0=A0=A0=A0printk(KERN_INFO "Registering Talitos RNG\n");
> +
> +=A0=A0=A0=A0=A0=A0=A0err =3D hwrng_register(&talitos_rng);
> +=A0=A0=A0=A0=A0=A0=A0if (err){
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0printk(".............. fail=
ure\n");
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0iounmap(rng_regs);
> +=A0=A0=A0=A0=A0=A0=A0}
This printk should have a KERN_ERROR or similar level.
Ideally, replace all instances of printk in your driver with 'dev_err',
'dev_info' or similar calls from <linux/device.h>.
Arnd <><
next prev parent reply other threads:[~2007-06-06 14:15 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-05 15:42 MPC8349ea Random Device Generator driver Philippe Lachenal
2007-06-06 14:15 ` Arnd Bergmann [this message]
2007-06-07 11:29 ` MPC8349ea Random Number " Philippe Lachenal
2007-06-07 14:03 ` Arnd Bergmann
2007-06-06 21:57 ` MPC8349ea Random Device " Timur Tabi
2007-06-06 22:09 ` Olof Johansson
2007-06-06 22:07 ` Timur Tabi
2007-06-06 22:11 ` Arnd Bergmann
2007-06-06 22:19 ` Timur Tabi
2007-06-06 22:35 ` Arnd Bergmann
2007-06-06 22:38 ` Timur Tabi
2007-06-06 22:24 ` Olof Johansson
2007-06-06 22:32 ` Timur Tabi
2007-06-06 23:54 ` Olof Johansson
2007-06-07 14:23 ` Timur Tabi
2007-06-07 15:20 ` Olof Johansson
2007-06-07 15:20 ` Timur Tabi
2007-06-07 15:36 ` Olof Johansson
2007-06-06 22:48 ` Timur Tabi
2007-06-07 0:00 ` Olof Johansson
2007-06-07 2:55 ` Kim Phillips
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200706061615.11380.arnd@arndb.de \
--to=arnd@arndb$(echo .)de \
--cc=linuxppc-dev@ozlabs$(echo .)org \
--cc=philippe.lachenal@hotmail$(echo .)fr \
--cc=sl@powerlinux$(echo .)fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox