From: Michael Grzeschik <hidden> Date: 2016-01-20 13:44:36
This patch adds support to enable and disable the xceiver
in case it's switchable by the regulator framework.
Signed-off-by: Michael Grzeschik <redacted>
---
v1 -> v2:
- always returning PTR_ERR in case devm_regulator_get fails
- removed inline wrapper functions with checks for xceiver == NULL
drivers/net/can/c_can/c_can.c | 12 ++++++++++++
drivers/net/can/c_can/c_can.h | 1 +
2 files changed, 13 insertions(+)
@@ -1263,6 +1271,10 @@ int register_c_can_dev(struct net_device *dev)*/pinctrl_pm_select_sleep_state(dev->dev.parent);+priv->reg_xceiver=devm_regulator_get(priv->device,"xceiver");+if(IS_ERR(priv->reg_xceiver))+returnPTR_ERR(priv->reg_xceiver);+c_can_pm_runtime_enable(priv);dev->flags|=IFF_ECHO;/* we support local echo */
From: Markus Pargmann <hidden> Date: 2016-01-20 14:01:26
Hi,
On Wednesday 20 January 2016 14:44:03 Michael Grzeschik wrote:
This patch adds support to enable and disable the xceiver
in case it's switchable by the regulator framework.
Signed-off-by: Michael Grzeschik <redacted>
Reviewed-by: Markus Pargmann <redacted>
quoted hunk
---
v1 -> v2:
- always returning PTR_ERR in case devm_regulator_get fails
- removed inline wrapper functions with checks for xceiver == NULL
drivers/net/can/c_can/c_can.c | 12 ++++++++++++
drivers/net/can/c_can/c_can.h | 1 +
2 files changed, 13 insertions(+)
@@ -1263,6 +1271,10 @@ int register_c_can_dev(struct net_device *dev)*/pinctrl_pm_select_sleep_state(dev->dev.parent);+priv->reg_xceiver=devm_regulator_get(priv->device,"xceiver");+if(IS_ERR(priv->reg_xceiver))+returnPTR_ERR(priv->reg_xceiver);+c_can_pm_runtime_enable(priv);dev->flags|=IFF_ECHO;/* we support local echo */
@@ -1263,6 +1271,10 @@ int register_c_can_dev(struct net_device *dev)*/pinctrl_pm_select_sleep_state(dev->dev.parent);+priv->reg_xceiver=devm_regulator_get(priv->device,"xceiver");
I assume "xceiver" is the shorter name for "transceiver"?
In that case, I suggest changing the devicetree label to "transceiver".
It would become a mess if different drivers use different names.
I see no real benefit for naming it "xceiver". "trx" is even shorter :-)
See also http://www.acronymfinder.com/TRX.html
The internals, like variable names, do not really matter here.
I haven't looked at other driver, yet the argument still stands.
The transceiver is named xceiver in all drivers.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
@@ -1263,6 +1271,10 @@ int register_c_can_dev(struct net_device *dev)*/pinctrl_pm_select_sleep_state(dev->dev.parent);+priv->reg_xceiver=devm_regulator_get(priv->device,"xceiver");
I assume "xceiver" is the shorter name for "transceiver"?
In that case, I suggest changing the devicetree label to "transceiver".
It would become a mess if different drivers use different names.
I see no real benefit for naming it "xceiver". "trx" is even shorter :-)
See also http://www.acronymfinder.com/TRX.html
The internals, like variable names, do not really matter here.
I haven't looked at other driver, yet the argument still stands.
Oh right and perhaps it is necessary to add some documentation for the
devicetree binding if it is not generic already? In that case the DT
mailing list is missing as well.
Best Regards,
Markus
--
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 |
@@ -1263,6 +1271,10 @@ int register_c_can_dev(struct net_device *dev)*/pinctrl_pm_select_sleep_state(dev->dev.parent);+priv->reg_xceiver=devm_regulator_get(priv->device,"xceiver");
I assume "xceiver" is the shorter name for "transceiver"?
In that case, I suggest changing the devicetree label to "transceiver".
It would become a mess if different drivers use different names.
I see no real benefit for naming it "xceiver". "trx" is even shorter :-)
See also http://www.acronymfinder.com/TRX.html
The internals, like variable names, do not really matter here.
I haven't looked at other driver, yet the argument still stands.
Kind regards,
Kurt