mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: "Teresa Gámez" <t.gamez@phytec.de>
Cc: barebox@lists.infradead.org
Subject: Re: [For next PATCH 1/3] of: Add of_register_disabled_device functions
Date: Mon, 3 Nov 2014 08:43:31 +0100	[thread overview]
Message-ID: <20141103074331.GB14443@pengutronix.de> (raw)
In-Reply-To: <1414670572-43351-1-git-send-email-t.gamez@phytec.de>

On Thu, Oct 30, 2014 at 01:02:50PM +0100, Teresa Gámez wrote:
> Function to enable and register a disabled device.
> The devices can be registered using the
> device node with of_register_disabled_device() or
> with the device node name/path by using the
> of_register_disabled_device_by_name() function.
> 
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
>  drivers/of/platform.c | 43 +++++++++++++++++++++++++++++++++++++++++++
>  include/of.h          | 14 ++++++++++++++
>  2 files changed, 57 insertions(+)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index c417cfd..e4a3042 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -197,6 +197,49 @@ static struct device_d *of_platform_device_create(struct device_node *np,
>  	return NULL;
>  }
>  
> +/**
> + * of_register_disabled_device - Enable and register device
> + * @np: pointer to node to enable create device for
> + *
> + * Returns pointer to created platform device, or NULL if a device was not
> + * registered. Unavailable devices will not get registered.
> + */
> +struct device_d *of_register_disabled_device(struct device_node *np)

We don't register a disabled device, so can we rename this to
of_device_enable_and_register?

> +{
> +	struct device_d *dev;
> +
> +	of_device_enable(np);
> +
> +	dev = of_platform_device_create(np, NULL);
> +	if (!dev)
> +		return NULL;
> +
> +	return dev;
> +}
> +EXPORT_SYMBOL(of_register_disabled_device);
> +
> +/**
> + * of_register_disabled_device - Enable and register device by name
> + * @name: name or path of the device node

The function name is wrong here.

> + *
> + * Returns pointer to created platform device, or NULL if a device was not
> + * registered. Unavailable devices will not get registered.
> + */
> +struct device_d *of_register_disabled_device_by_name(const char *name)

of_device_enable_and_register_by_name

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2014-11-03  7:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 12:02 Teresa Gámez
2014-10-30 12:02 ` [For next PATCH 2/3] ARM: am335x: Add register of boot devices Teresa Gámez
2014-10-30 12:02 ` [For next PATCH 3/3] ARM: am335x: phyCORE-AM335x: Create new dts for MLO Teresa Gámez
2014-11-03  7:43 ` Sascha Hauer [this message]

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=20141103074331.GB14443@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=t.gamez@phytec.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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