[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110622125252.66eceb46@schlenkerla.am.freescale.net>
Date: Wed, 22 Jun 2011 12:52:52 -0500
From: Scott Wood <scottwood@...escale.com>
To: Kumar Gala <galak@...nel.crashing.org>
CC: Greg KH <greg@...ah.com>, <linuxppc-dev@...abs.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 1/3] driver core: Add ability for arch code to setup
pdev_archdata
On Wed, 22 Jun 2011 10:09:56 -0500
Kumar Gala <galak@...nel.crashing.org> wrote:
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 1c291af..c25e0c0 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -20,6 +20,7 @@
> #include <linux/err.h>
> #include <linux/slab.h>
> #include <linux/pm_runtime.h>
> +#include <asm/platform_device.h>
>
> #include "base.h"
>
> @@ -173,6 +174,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
> pa->pdev.id = id;
> device_initialize(&pa->pdev.dev);
> pa->pdev.dev.release = platform_device_release;
> + arch_setup_pdev_archdata(&pa->pdev);
> }
>
> return pa ? &pa->pdev : NULL;
Need to call this from platform_device_register() as well, for devices
which are not dynamically allocated.
> +/*
> + * an architecture can override to define arch_setup_pdev_archdata
> + */
> +#ifndef arch_setup_pdev_archdata
> +static inline void arch_setup_pdev_archdata(struct platform_device *pdev) { }
> +#endif
That's not a particularly useful comment. More useful would be a statement
of when this hook is called, examples of what it's meant to be used for,
etc.
-Scott
--
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