From: Kishon Vijay Abraham I <kishon@ti.com>
To: Kamil Debski <k.debski@samsung.com>
Cc: linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org,
linux-usb@vger.kernel.org, devicetree@vger.kernel.org,
kyungmin.park@samsung.com, t.figa@samsung.com,
s.nawrocki@samsung.com, m.szyprowski@samsung.com,
gautam.vivek@samsung.com, mat.krawczuk@gmail.com,
yulgon.kim@samsung.com, p.paneri@samsung.com,
av.tikhomirov@samsung.com, jg1.han@samsung.com,
galak@codeaurora.org, matt.porter@linaro.org,
tjakobi@math.uni-bielefeld.de, stern@rowland.harvard.edu
Subject: Re: [PATCH v4 2/9] phy: core: Add devm_of_phy_get to phy-core
Date: Mon, 6 Jan 2014 12:44:35 +0530 [thread overview]
Message-ID: <52CA57DB.9040405@ti.com> (raw)
In-Reply-To: <1387545857-9472-3-git-send-email-k.debski@samsung.com>
On Friday 20 December 2013 06:54 PM, Kamil Debski wrote:
> Adding devm_of_phy_get will allow to get phys by supplying a
> pointer to the struct device_node instead of struct device.
>
> Signed-off-by: Kamil Debski <k.debski@samsung.com>
> ---
> drivers/phy/phy-core.c | 31 +++++++++++++++++++++++++++++++
> include/linux/phy/phy.h | 2 ++
> 2 files changed, 33 insertions(+)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index d6f8c34..0551cc3 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -450,6 +450,37 @@ struct phy *devm_phy_get(struct device *dev, const char *string)
> EXPORT_SYMBOL_GPL(devm_phy_get);
>
> /**
> + * devm_of_phy_get() - lookup and obtain a reference to a phy.
> + * @dev: device that requests this phy
> + * @np: node containing the phy
> + * @con_id: name of the phy from device's point of view
> + *
> + * Gets the phy using of_phy_get(), and associates a device with it using
> + * devres. On driver detach, release function is invoked on the devres data,
> + * then, devres data is freed.
> + */
> +struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
> + const char *con_id)
> +{
> + struct phy **ptr, *phy;
> +
> + ptr = devres_alloc(devm_phy_release, sizeof(*ptr), GFP_KERNEL);
> + if (!ptr)
> + return ERR_PTR(-ENOMEM);
> +
> + phy = of_phy_get(np, con_id);
> + if (!IS_ERR(phy)) {
> + *ptr = phy;
> + devres_add(dev, ptr);
> + } else {
> + devres_free(ptr);
> + }
> +
> + return phy;
> +}
> +EXPORT_SYMBOL_GPL(devm_of_phy_get);
> +
> +/**
> * phy_create() - create a new phy
> * @dev: device that is creating the new phy
> * @ops: function pointers for performing phy operations
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index bcb6274..864914c 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -129,6 +129,8 @@ int phy_power_on(struct phy *phy);
> int phy_power_off(struct phy *phy);
> struct phy *phy_get(struct device *dev, const char *string);
> struct phy *devm_phy_get(struct device *dev, const char *string);
> +struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
> + const char *con_id);
stub for devm_of_phy_get also..
Thanks
Kishon
> void phy_put(struct phy *phy);
> void devm_phy_put(struct device *dev, struct phy *phy);
> struct phy *of_phy_get(struct device_node *np, const char *con_id);
>
WARNING: multiple messages have this Message-ID (diff)
From: Kishon Vijay Abraham I <kishon@ti.com>
To: Kamil Debski <k.debski@samsung.com>
Cc: <linux-kernel@vger.kernel.org>,
<linux-samsung-soc@vger.kernel.org>, <linux-usb@vger.kernel.org>,
<devicetree@vger.kernel.org>, <kyungmin.park@samsung.com>,
<t.figa@samsung.com>, <s.nawrocki@samsung.com>,
<m.szyprowski@samsung.com>, <gautam.vivek@samsung.com>,
<mat.krawczuk@gmail.com>, <yulgon.kim@samsung.com>,
<p.paneri@samsung.com>, <av.tikhomirov@samsung.com>,
<jg1.han@samsung.com>, <galak@codeaurora.org>,
<matt.porter@linaro.org>, <tjakobi@math.uni-bielefeld.de>,
<stern@rowland.harvard.edu>
Subject: Re: [PATCH v4 2/9] phy: core: Add devm_of_phy_get to phy-core
Date: Mon, 6 Jan 2014 12:44:35 +0530 [thread overview]
Message-ID: <52CA57DB.9040405@ti.com> (raw)
In-Reply-To: <1387545857-9472-3-git-send-email-k.debski@samsung.com>
On Friday 20 December 2013 06:54 PM, Kamil Debski wrote:
> Adding devm_of_phy_get will allow to get phys by supplying a
> pointer to the struct device_node instead of struct device.
>
> Signed-off-by: Kamil Debski <k.debski@samsung.com>
> ---
> drivers/phy/phy-core.c | 31 +++++++++++++++++++++++++++++++
> include/linux/phy/phy.h | 2 ++
> 2 files changed, 33 insertions(+)
>
> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
> index d6f8c34..0551cc3 100644
> --- a/drivers/phy/phy-core.c
> +++ b/drivers/phy/phy-core.c
> @@ -450,6 +450,37 @@ struct phy *devm_phy_get(struct device *dev, const char *string)
> EXPORT_SYMBOL_GPL(devm_phy_get);
>
> /**
> + * devm_of_phy_get() - lookup and obtain a reference to a phy.
> + * @dev: device that requests this phy
> + * @np: node containing the phy
> + * @con_id: name of the phy from device's point of view
> + *
> + * Gets the phy using of_phy_get(), and associates a device with it using
> + * devres. On driver detach, release function is invoked on the devres data,
> + * then, devres data is freed.
> + */
> +struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
> + const char *con_id)
> +{
> + struct phy **ptr, *phy;
> +
> + ptr = devres_alloc(devm_phy_release, sizeof(*ptr), GFP_KERNEL);
> + if (!ptr)
> + return ERR_PTR(-ENOMEM);
> +
> + phy = of_phy_get(np, con_id);
> + if (!IS_ERR(phy)) {
> + *ptr = phy;
> + devres_add(dev, ptr);
> + } else {
> + devres_free(ptr);
> + }
> +
> + return phy;
> +}
> +EXPORT_SYMBOL_GPL(devm_of_phy_get);
> +
> +/**
> * phy_create() - create a new phy
> * @dev: device that is creating the new phy
> * @ops: function pointers for performing phy operations
> diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
> index bcb6274..864914c 100644
> --- a/include/linux/phy/phy.h
> +++ b/include/linux/phy/phy.h
> @@ -129,6 +129,8 @@ int phy_power_on(struct phy *phy);
> int phy_power_off(struct phy *phy);
> struct phy *phy_get(struct device *dev, const char *string);
> struct phy *devm_phy_get(struct device *dev, const char *string);
> +struct phy *devm_of_phy_get(struct device *dev, struct device_node *np,
> + const char *con_id);
stub for devm_of_phy_get also..
Thanks
Kishon
> void phy_put(struct phy *phy);
> void devm_phy_put(struct device *dev, struct phy *phy);
> struct phy *of_phy_get(struct device_node *np, const char *con_id);
>
next prev parent reply other threads:[~2014-01-06 7:15 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-20 13:24 [PATCH v5 0/9] phy: Add new Exynos USB 2.0 PHY driver Kamil Debski
2013-12-20 13:24 ` Kamil Debski
2013-12-20 13:24 ` [PATCH v4 1/9] phy: core: Add an exported of_phy_get function Kamil Debski
[not found] ` <1387545857-9472-2-git-send-email-k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-01-06 7:12 ` Kishon Vijay Abraham I
2014-01-06 7:12 ` Kishon Vijay Abraham I
2013-12-20 13:24 ` [PATCH v4 2/9] phy: core: Add devm_of_phy_get to phy-core Kamil Debski
2014-01-06 7:14 ` Kishon Vijay Abraham I [this message]
2014-01-06 7:14 ` Kishon Vijay Abraham I
2013-12-20 13:24 ` [PATCH v5 3/9] phy: Add new Exynos USB 2.0 PHY driver Kamil Debski
2014-01-06 10:12 ` Kishon Vijay Abraham I
2014-01-06 10:12 ` Kishon Vijay Abraham I
[not found] ` <52CA818A.4090403-l0cyMroinI0@public.gmane.org>
2014-01-08 17:56 ` Kamil Debski
2014-01-08 17:56 ` Kamil Debski
2014-01-09 5:27 ` Kishon Vijay Abraham I
2014-01-09 5:27 ` Kishon Vijay Abraham I
2013-12-20 13:24 ` [PATCH v5 4/9] usb: ehci-s5p: Change to use phy provided by the generic phy framework Kamil Debski
2013-12-26 10:13 ` Vivek Gautam
2013-12-30 13:43 ` Kamil Debski
2013-12-20 13:24 ` [PATCH v5 5/9] usb: s3c-hsotg: Use the new Exynos USB phy driver with " Kamil Debski
2013-12-20 13:24 ` [PATCH v5 7/9] phy: Add Exynos 5250 support to the Exynos USB 2.0 PHY driver Kamil Debski
2013-12-20 13:24 ` [PATCH v2 8/9] dts: Add usb2phy to Exynos 4 Kamil Debski
[not found] ` <1387545857-9472-1-git-send-email-k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-12-20 13:24 ` [PATCH v5 6/9] phy: Add support for S5PV210 to the Exynos USB 2.0 PHY driver Kamil Debski
2013-12-20 13:24 ` Kamil Debski
2014-01-04 14:37 ` [PATCH v6 " Tomasz Figa
2013-12-20 13:24 ` [PATCH v2 9/9] dts: Add usb2phy to Exynos 5250 Kamil Debski
2013-12-20 13:24 ` Kamil Debski
[not found] ` <1387545857-9472-10-git-send-email-k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-12-26 10:32 ` Vivek Gautam
2013-12-26 10:32 ` Vivek Gautam
2013-12-30 15:18 ` Kamil Debski
2013-12-20 13:24 ` [PATCH RFC alternative ver 1] phy: Exynos 421x USB 2.0 PHY support Kamil Debski
2013-12-20 13:24 ` Kamil Debski
[not found] ` <1387545857-9472-11-git-send-email-k.debski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-01-06 10:24 ` Kishon Vijay Abraham I
2014-01-06 10:24 ` Kishon Vijay Abraham I
2014-01-08 17:42 ` Kamil Debski
2014-01-02 16:20 ` [PATCH v5 0/9] phy: Add new Exynos USB 2.0 PHY driver Kamil Debski
2014-01-02 16:20 ` Kamil Debski
2014-01-02 16:31 ` Kishon Vijay Abraham I
2014-01-02 16:31 ` Kishon Vijay Abraham I
2013-12-20 13:24 ` [PATCH RFC alternative ver 2] phy: Exynos 421x USB 2.0 PHY support Kamil Debski
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=52CA57DB.9040405@ti.com \
--to=kishon@ti.com \
--cc=av.tikhomirov@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=gautam.vivek@samsung.com \
--cc=jg1.han@samsung.com \
--cc=k.debski@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mat.krawczuk@gmail.com \
--cc=matt.porter@linaro.org \
--cc=p.paneri@samsung.com \
--cc=s.nawrocki@samsung.com \
--cc=stern@rowland.harvard.edu \
--cc=t.figa@samsung.com \
--cc=tjakobi@math.uni-bielefeld.de \
--cc=yulgon.kim@samsung.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.