diff mbox

RFC: [PATCH] can: c_can: disable one shot mode until driver is fixed

Message ID 20110324102852.GA339@e-circ.dyndns.org
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Kurt Van Dijck March 24, 2011, 10:28 a.m. UTC
On Thu, Mar 24, 2011 at 11:12:29AM +0100, Marc Kleine-Budde wrote:
> This patch disables the one shot mode, until the driver has been fixed and
> tested to support it.
> 
isn't this part necessary now (temporarily) to avoid dead code?


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Marc Kleine-Budde March 24, 2011, 10:44 a.m. UTC | #1
On 03/24/2011 11:28 AM, Kurt Van Dijck wrote:
> On Thu, Mar 24, 2011 at 11:12:29AM +0100, Marc Kleine-Budde wrote:
>> This patch disables the one shot mode, until the driver has been fixed and
>> tested to support it.
>>
> isn't this part necessary now (temporarily) to avoid dead code?

It's not necessary, the driver should still work. But it's dead code. If
someone fixes the driver she/he can easily revert the patch.

Can I fold your patch and add your S-o-b?

Marc
> 
> diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
> index 1405078..2c3d090 100644
> --- a/drivers/net/can/c_can/c_can.c
> +++ b/drivers/net/can/c_can/c_can.c
> @@ -588,14 +588,9 @@ static void c_can_chip_config(struct net_device *dev)
>  {
>  	struct c_can_priv *priv = netdev_priv(dev);
>  
> -	if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT)
> -		/* disable automatic retransmission */
> -		priv->write_reg(priv, &priv->regs->control,
> -				CONTROL_DISABLE_AR);
> -	else
> -		/* enable automatic retransmission */
> -		priv->write_reg(priv, &priv->regs->control,
> -				CONTROL_ENABLE_AR);
> +	/* enable automatic retransmission */
> +	priv->write_reg(priv, &priv->regs->control,
> +			CONTROL_ENABLE_AR);
>  
>  	if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY &
>  					CAN_CTRLMODE_LOOPBACK)) {
> 
> _______________________________________________
> Socketcan-core mailing list
> Socketcan-core@lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/socketcan-core
Kurt Van Dijck March 24, 2011, 10:52 a.m. UTC | #2
On Thu, Mar 24, 2011 at 11:44:46AM +0100, Marc Kleine-Budde wrote:
> On 03/24/2011 11:28 AM, Kurt Van Dijck wrote:
> > On Thu, Mar 24, 2011 at 11:12:29AM +0100, Marc Kleine-Budde wrote:
> >> This patch disables the one shot mode, until the driver has been fixed and
> >> tested to support it.
> >>
> > isn't this part necessary now (temporarily) to avoid dead code?
> 
> It's not necessary, the driver should still work.
Yep, I saw that.
> But it's dead code. If
> someone fixes the driver she/he can easily revert the patch.
> 
> Can I fold your patch and add your S-o-b?
Yes.
> 
Kurt
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 1405078..2c3d090 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -588,14 +588,9 @@  static void c_can_chip_config(struct net_device *dev)
 {
 	struct c_can_priv *priv = netdev_priv(dev);
 
-	if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT)
-		/* disable automatic retransmission */
-		priv->write_reg(priv, &priv->regs->control,
-				CONTROL_DISABLE_AR);
-	else
-		/* enable automatic retransmission */
-		priv->write_reg(priv, &priv->regs->control,
-				CONTROL_ENABLE_AR);
+	/* enable automatic retransmission */
+	priv->write_reg(priv, &priv->regs->control,
+			CONTROL_ENABLE_AR);
 
 	if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY &
 					CAN_CTRLMODE_LOOPBACK)) {