[PATCH 6/7] mpc83xx: timer driver for PM wakeup
Anton Vorontsov
cbou at mail.ru
Sat Oct 27 20:46:07 EST 2007
Hi Scott,
On Tue, Oct 23, 2007 at 04:25:02PM -0500, Scott Wood wrote:
> This is a driver for the mpc83xx's GTM4 timer. It's functionality
> is limited to providing a wakeup source for suspend-to-RAM.
>
> Signed-off-by: Scott Wood <scottwood at freescale.com>
I think you can use dev_err(&dev->dev
> +static int __devinit gtm_probe(struct of_device *dev,
> + const struct of_device_id *match)
> +{
> + struct device_node *np = dev->node;
> + struct resource res;
> + int ret = 0;
> + u32 busfreq = fsl_get_sys_freq();
> + struct gtm_priv *priv;
> +
> + if (busfreq == 0) {
> + printk(KERN_ERR "gtm: No bus frequency in device tree.\n");
here
> + return -ENODEV;
> + }
> +
> + priv = kmalloc(sizeof(struct gtm_priv), GFP_KERNEL);
> + if (!priv)
> + return -ENOMEM;
> +
> + spin_lock_init(&priv->lock);
> + dev_set_drvdata(&dev->dev, priv);
> +
> + ret = of_address_to_resource(np, 0, &res);
> + if (ret)
> + goto out;
> +
> + priv->irq = irq_of_parse_and_map(np, 0);
> + if (priv->irq == NO_IRQ) {
> + printk(KERN_ERR "mpc83xx-gtm exists in device tree "
> + "without an IRQ.\n");
and here.
Thanks,
--
Anton Vorontsov
email: cbou at mail.ru
backup email: ya-cbou at yandex.ru
irc://irc.freenode.net/bd2
More information about the Linuxppc-dev
mailing list