From: Hans de Goede <hidden> Date: 2014-01-05 23:06:28
Printing an error on probe-deferral clearly is not the right thing to do.
While at it I've also silenced the error in case of -ENODATA, so that
devm_phy_get can be used to get an optional phy without causing errors to
be printed. Alternatively a new devm_phy_get_optional method could be
added for this.
While at it also factor the error handling out of the if ... else ..., as it
is identical in both branches.
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
From: Hans de Goede <hidden> Date: 2014-01-05 23:06:29
The phy-core allows phy_init and phy_power_on to be called multiple times,
but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
propagated to the caller for the 2nd and later calls.
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Sergei Shtylyov <hidden> Date: 2014-01-06 17:37:09
Hello.
On 06-01-2014 3:06, Hans de Goede wrote:
The phy-core allows phy_init and phy_power_on to be called multiple times,
but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
propagated to the caller for the 2nd and later calls.
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Kishon Vijay Abraham I <hidden> Date: 2014-01-07 08:56:50
Hi,
On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
The phy-core allows phy_init and phy_power_on to be called multiple times,
but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
propagated to the caller for the 2nd and later calls.
Thanks for fixing this. Have one minor comment below.
quoted hunk
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Kishon Vijay Abraham I <hidden> Date: 2014-01-07 08:58:07
On Tuesday 07 January 2014 02:26 PM, Kishon Vijay Abraham I wrote:
Hi,
On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
quoted
The phy-core allows phy_init and phy_power_on to be called multiple times,
but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
propagated to the caller for the 2nd and later calls.
Thanks for fixing this. Have one minor comment below.
quoted
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Hans de Goede <hidden> Date: 2014-01-07 09:13:10
Hi,
On 01/07/2014 09:56 AM, Kishon Vijay Abraham I wrote:
Hi,
On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
quoted
The phy-core allows phy_init and phy_power_on to be called multiple times,
but before this patch -ENOSUPP from phy_pm_runtime_get_sync would be
propagated to the caller for the 2nd and later calls.
Thanks for fixing this. Have one minor comment below.
quoted
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
From: Kishon Vijay Abraham I <hidden> Date: 2014-01-07 09:31:02
Hi,
On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
Printing an error on probe-deferral clearly is not the right thing to do.
While at it I've also silenced the error in case of -ENODATA, so that
devm_phy_get can be used to get an optional phy without causing errors to
What do you mean by optional phy here?
Thanks
Kishon
quoted hunk
be printed. Alternatively a new devm_phy_get_optional method could be
added for this.
While at it also factor the error handling out of the if ... else ..., as it
is identical in both branches.
Signed-off-by: Hans de Goede <redacted>
---
drivers/phy/phy-core.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
From: Hans de Goede <hidden> Date: 2014-01-07 09:53:00
Hi,
On 01/07/2014 10:31 AM, Kishon Vijay Abraham I wrote:
Hi,
On Monday 06 January 2014 04:36 AM, Hans de Goede wrote:
quoted
Printing an error on probe-deferral clearly is not the right thing to do.
While at it I've also silenced the error in case of -ENODATA, so that
devm_phy_get can be used to get an optional phy without causing errors to
What do you mean by optional phy here?
Some generic platform drivers, ie drivers/usb/host/ehci-platform.c
(with some extensions to make it more generic I'm working on), may
take a phy in the devicetree-node, but having a phy is not mandatory,
the code using the phy will all be guarded against the phy not being
there and only call phy_ functions if it is actually there.
For this use case it would be nice if in this case devm_phy_get would
return an error code, but not do a dev_err, so as to not pollute dmesg
with irrelevant / wrong error messages.
The regulator core has devm_regulator_get_optional for this, so
if you don't want this silent behavior in devm_phy_get by default,
I can do write a different patch adding devm_phy_get_optional
instead.
Also I've just realized that this check:
quoted
+ if (err != -EPROBE_DEFER && err != -ENODATA)
+ dev_err(dev, "unable to get phy\n");
Is incomplete to also be silent when no phy-names are specified,
it should be:
if (err != -EPROBE_DEFER && err != -ENODATA && err != -EINVAL)
dev_err(dev, "unable to get phy\n");
I'll fix this (or add a devm_phy_get_optional) in v2 of this set.
Regards,
Hans