Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 54f0e9ba authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next



Marc Kleine-Budde says:

====================
the fifth pull request for upcoming v3.6 net-next cleans up and
improves the janz-ican3 driver (6 patches by Ira W. Snyder, one by me).
A patch by Steffen Trumtrar adds imx53 support to the flexcan driver.
And another patch by me, which marks the bit timing constant in the CAN
drivers as "const".
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 90b90f60 3b5c6b9e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ static const struct at91_devtype_data at91_devtype_data[] __devinitconst = {
	},
};

static struct can_bittiming_const at91_bittiming_const = {
static const struct can_bittiming_const at91_bittiming_const = {
	.name		= KBUILD_MODNAME,
	.tseg1_min	= 4,
	.tseg1_max	= 16,
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@ struct bfin_can_priv {
/*
 * bfin can timing parameters
 */
static struct can_bittiming_const bfin_can_bittiming_const = {
static const struct can_bittiming_const bfin_can_bittiming_const = {
	.name = DRV_NAME,
	.tseg1_min = 1,
	.tseg1_max = 16,
+1 −1
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ enum c_can_bus_error_types {
	C_CAN_ERROR_PASSIVE,
};

static struct can_bittiming_const c_can_bittiming_const = {
static const struct can_bittiming_const c_can_bittiming_const = {
	.name = KBUILD_MODNAME,
	.tseg1_min = 2,		/* Time segment 1 = prop_seg + phase_seg1 */
	.tseg1_max = 16,
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ static unsigned char cc770_obj_flags[CC770_OBJ_MAX] = {
	[CC770_OBJ_TX] = 0,
};

static struct can_bittiming_const cc770_bittiming_const = {
static const struct can_bittiming_const cc770_bittiming_const = {
	.name = KBUILD_MODNAME,
	.tseg1_min = 1,
	.tseg1_max = 16,
+28 −19
Original line number Diff line number Diff line
@@ -190,7 +190,8 @@ struct flexcan_priv {
	u32 reg_esr;
	u32 reg_ctrl_default;

	struct clk *clk;
	struct clk *clk_ipg;
	struct clk *clk_per;
	struct flexcan_platform_data *pdata;
	const struct flexcan_devtype_data *devtype_data;
};
@@ -203,7 +204,7 @@ static struct flexcan_devtype_data fsl_imx6q_devtype_data = {
	.hw_ver = 10,
};

static struct can_bittiming_const flexcan_bittiming_const = {
static const struct can_bittiming_const flexcan_bittiming_const = {
	.name = DRV_NAME,
	.tseg1_min = 4,
	.tseg1_max = 16,
@@ -828,7 +829,8 @@ static int flexcan_open(struct net_device *dev)
	struct flexcan_priv *priv = netdev_priv(dev);
	int err;

	clk_prepare_enable(priv->clk);
	clk_prepare_enable(priv->clk_ipg);
	clk_prepare_enable(priv->clk_per);

	err = open_candev(dev);
	if (err)
@@ -850,7 +852,8 @@ static int flexcan_open(struct net_device *dev)
 out_close:
	close_candev(dev);
 out:
	clk_disable_unprepare(priv->clk);
	clk_disable_unprepare(priv->clk_per);
	clk_disable_unprepare(priv->clk_ipg);

	return err;
}
@@ -864,7 +867,8 @@ static int flexcan_close(struct net_device *dev)
	flexcan_chip_stop(dev);

	free_irq(dev->irq, dev);
	clk_disable_unprepare(priv->clk);
	clk_disable_unprepare(priv->clk_per);
	clk_disable_unprepare(priv->clk_ipg);

	close_candev(dev);

@@ -903,7 +907,8 @@ static int __devinit register_flexcandev(struct net_device *dev)
	struct flexcan_regs __iomem *regs = priv->base;
	u32 reg, err;

	clk_prepare_enable(priv->clk);
	clk_prepare_enable(priv->clk_ipg);
	clk_prepare_enable(priv->clk_per);

	/* select "bus clock", chip must be disabled */
	flexcan_chip_disable(priv);
@@ -936,7 +941,8 @@ static int __devinit register_flexcandev(struct net_device *dev)
 out:
	/* disable core and turn off clocks */
	flexcan_chip_disable(priv);
	clk_disable_unprepare(priv->clk);
	clk_disable_unprepare(priv->clk_per);
	clk_disable_unprepare(priv->clk_ipg);

	return err;
}
@@ -964,7 +970,7 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
	struct net_device *dev;
	struct flexcan_priv *priv;
	struct resource *mem;
	struct clk *clk = NULL;
	struct clk *clk_ipg = NULL, *clk_per = NULL;
	struct pinctrl *pinctrl;
	void __iomem *base;
	resource_size_t mem_size;
@@ -980,13 +986,20 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
						"clock-frequency", &clock_freq);

	if (!clock_freq) {
		clk = clk_get(&pdev->dev, NULL);
		if (IS_ERR(clk)) {
			dev_err(&pdev->dev, "no clock defined\n");
			err = PTR_ERR(clk);
		clk_ipg = devm_clk_get(&pdev->dev, "ipg");
		if (IS_ERR(clk_ipg)) {
			dev_err(&pdev->dev, "no ipg clock defined\n");
			err = PTR_ERR(clk_ipg);
			goto failed_clock;
		}
		clock_freq = clk_get_rate(clk_ipg);

		clk_per = devm_clk_get(&pdev->dev, "per");
		if (IS_ERR(clk_per)) {
			dev_err(&pdev->dev, "no per clock defined\n");
			err = PTR_ERR(clk_per);
			goto failed_clock;
		}
		clock_freq = clk_get_rate(clk);
	}

	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1039,7 +1052,8 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
		CAN_CTRLMODE_BERR_REPORTING;
	priv->base = base;
	priv->dev = dev;
	priv->clk = clk;
	priv->clk_ipg = clk_ipg;
	priv->clk_per = clk_per;
	priv->pdata = pdev->dev.platform_data;
	priv->devtype_data = devtype_data;

@@ -1067,8 +1081,6 @@ static int __devinit flexcan_probe(struct platform_device *pdev)
 failed_map:
	release_mem_region(mem->start, mem_size);
 failed_get:
	if (clk)
		clk_put(clk);
 failed_clock:
	return err;
}
@@ -1086,9 +1098,6 @@ static int __devexit flexcan_remove(struct platform_device *pdev)
	mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	release_mem_region(mem->start, resource_size(mem));

	if (priv->clk)
		clk_put(priv->clk);

	free_candev(dev);

	return 0;
Loading