|
@@ -592,6 +592,7 @@ static int c_can_start(struct net_device *dev)
|
|
{
|
|
{
|
|
struct c_can_priv *priv = netdev_priv(dev);
|
|
struct c_can_priv *priv = netdev_priv(dev);
|
|
int err;
|
|
int err;
|
|
|
|
+ struct pinctrl *p;
|
|
|
|
|
|
/* basic c_can configuration */
|
|
/* basic c_can configuration */
|
|
err = c_can_chip_config(dev);
|
|
err = c_can_chip_config(dev);
|
|
@@ -604,8 +605,13 @@ static int c_can_start(struct net_device *dev)
|
|
|
|
|
|
priv->can.state = CAN_STATE_ERROR_ACTIVE;
|
|
priv->can.state = CAN_STATE_ERROR_ACTIVE;
|
|
|
|
|
|
- /* activate pins */
|
|
|
|
- pinctrl_pm_select_default_state(dev->dev.parent);
|
|
|
|
|
|
+ /* Attempt to use "active" if available else use "default" */
|
|
|
|
+ p = pinctrl_get_select(priv->device, "active");
|
|
|
|
+ if (!IS_ERR(p))
|
|
|
|
+ pinctrl_put(p);
|
|
|
|
+ else
|
|
|
|
+ pinctrl_pm_select_default_state(priv->device);
|
|
|
|
+
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|