Skip to content

Commit e0580b5

Browse files
committed
Merge tag 'linux-can-next-for-5.5-20191111' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
Marc Kleine-Budde says: ==================== pull-request: can-next 2019-10-07 this is a pull request for net-next/master consisting of 32 patches. The first patch is by Gustavo A. R. Silva and removes unused code in the generic CAN infrastructure. The next three patches target the mcp251x driver. The one by Andy Shevchenko removes the legacy platform data support from the driver. The other two are by Timo Schlüßler and reset the device only when needed, to prevent glitches on the output when GPIO support is added. I'm contributing two patches fixing checkpatch warnings in the c_can_platform and peak_canfd driver. Stephane Grosjean's patch for the peak_canfd driver adds hw timestamps support in rx skbs. The next three patches target the xilinx_can driver. One patch by me to fix checkpatch warnings, one patch by Anssi Hannula to avoid non requested bus error frames, and a patch by YueHaibing that switches the driver to devm_platform_ioremap_resource(). Pankaj Sharma contributes two patches for the m_can driver, the first one adds support for one shot mode, the other support for handling arbitration errors. Followed by four patches by YueHaibing, switching the grcan, ifi, rcar, and sun4i drivers to devm_platform_ioremap_resource() I'm contributing cleanup patches for the rx-offload helper, while Joakim Zhang's patch prepares the rx-offload helper for CAN-FD support. The rx offload users flexcan and ti_hecc are converted accordingly. The remaining twelve patches target the flexcan driver. First Joakim Zhang switches the driver to devm_platform_ioremap_resource(). The remaining eleven patch are by me and clean up the abstract the access of the iflag1 and iflag2 register both for RX and TX mailboxes. This is a preparation for the upcoming CAN-FD support. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 9440a87 + b9468ad commit e0580b5

File tree

20 files changed

+360
-277
lines changed

20 files changed

+360
-277
lines changed

arch/arm/mach-pxa/icontrol.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#include <linux/irq.h>
1414
#include <linux/platform_device.h>
15+
#include <linux/property.h>
1516
#include <linux/gpio.h>
1617

1718
#include <asm/mach-types.h>
@@ -22,7 +23,6 @@
2223

2324
#include <linux/spi/spi.h>
2425
#include <linux/spi/pxa2xx_spi.h>
25-
#include <linux/can/platform/mcp251x.h>
2626
#include <linux/regulator/machine.h>
2727

2828
#include "generic.h"
@@ -69,8 +69,9 @@ static struct pxa2xx_spi_chip mcp251x_chip_info4 = {
6969
.gpio_cs = ICONTROL_MCP251x_nCS4
7070
};
7171

72-
static struct mcp251x_platform_data mcp251x_info = {
73-
.oscillator_frequency = 16E6,
72+
static const struct property_entry mcp251x_properties[] = {
73+
PROPERTY_ENTRY_U32("clock-frequency", 16000000),
74+
{}
7475
};
7576

7677
static struct spi_board_info mcp251x_board_info[] = {
@@ -79,7 +80,7 @@ static struct spi_board_info mcp251x_board_info[] = {
7980
.max_speed_hz = 6500000,
8081
.bus_num = 3,
8182
.chip_select = 0,
82-
.platform_data = &mcp251x_info,
83+
.properties = mcp251x_properties,
8384
.controller_data = &mcp251x_chip_info1,
8485
.irq = PXA_GPIO_TO_IRQ(ICONTROL_MCP251x_nIRQ1)
8586
},

arch/arm/mach-pxa/zeus.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/leds.h>
1414
#include <linux/irq.h>
1515
#include <linux/pm.h>
16+
#include <linux/property.h>
1617
#include <linux/gpio.h>
1718
#include <linux/gpio/machine.h>
1819
#include <linux/serial_8250.h>
@@ -27,7 +28,6 @@
2728
#include <linux/platform_data/i2c-pxa.h>
2829
#include <linux/platform_data/pca953x.h>
2930
#include <linux/apm-emulation.h>
30-
#include <linux/can/platform/mcp251x.h>
3131
#include <linux/regulator/fixed.h>
3232
#include <linux/regulator/machine.h>
3333

@@ -428,14 +428,15 @@ static struct gpiod_lookup_table can_regulator_gpiod_table = {
428428
},
429429
};
430430

431-
static struct mcp251x_platform_data zeus_mcp2515_pdata = {
432-
.oscillator_frequency = 16*1000*1000,
431+
static const struct property_entry mcp251x_properties[] = {
432+
PROPERTY_ENTRY_U32("clock-frequency", 16000000),
433+
{}
433434
};
434435

435436
static struct spi_board_info zeus_spi_board_info[] = {
436437
[0] = {
437438
.modalias = "mcp2515",
438-
.platform_data = &zeus_mcp2515_pdata,
439+
.properties = mcp251x_properties,
439440
.irq = PXA_GPIO_TO_IRQ(ZEUS_CAN_GPIO),
440441
.max_speed_hz = 1*1000*1000,
441442
.bus_num = 3,

drivers/net/can/c_can/c_can_platform.c

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@
3939

4040
#include "c_can.h"
4141

42-
#define DCAN_RAM_INIT_BIT (1 << 3)
42+
#define DCAN_RAM_INIT_BIT BIT(3)
43+
4344
static DEFINE_SPINLOCK(raminit_lock);
44-
/*
45-
* 16-bit c_can registers can be arranged differently in the memory
45+
46+
/* 16-bit c_can registers can be arranged differently in the memory
4647
* architecture of different implementations. For example: 16-bit
4748
* registers can be aligned to a 16-bit boundary or 32-bit boundary etc.
4849
* Handle the same by providing a common read/write interface.
@@ -54,7 +55,7 @@ static u16 c_can_plat_read_reg_aligned_to_16bit(const struct c_can_priv *priv,
5455
}
5556

5657
static void c_can_plat_write_reg_aligned_to_16bit(const struct c_can_priv *priv,
57-
enum reg index, u16 val)
58+
enum reg index, u16 val)
5859
{
5960
writew(val, priv->base + priv->regs[index]);
6061
}
@@ -66,7 +67,7 @@ static u16 c_can_plat_read_reg_aligned_to_32bit(const struct c_can_priv *priv,
6667
}
6768

6869
static void c_can_plat_write_reg_aligned_to_32bit(const struct c_can_priv *priv,
69-
enum reg index, u16 val)
70+
enum reg index, u16 val)
7071
{
7172
writew(val, priv->base + 2 * priv->regs[index]);
7273
}
@@ -144,13 +145,13 @@ static u32 c_can_plat_read_reg32(const struct c_can_priv *priv, enum reg index)
144145
u32 val;
145146

146147
val = priv->read_reg(priv, index);
147-
val |= ((u32) priv->read_reg(priv, index + 1)) << 16;
148+
val |= ((u32)priv->read_reg(priv, index + 1)) << 16;
148149

149150
return val;
150151
}
151152

152-
static void c_can_plat_write_reg32(const struct c_can_priv *priv, enum reg index,
153-
u32 val)
153+
static void c_can_plat_write_reg32(const struct c_can_priv *priv,
154+
enum reg index, u32 val)
154155
{
155156
priv->write_reg(priv, index + 1, val >> 16);
156157
priv->write_reg(priv, index, val);
@@ -161,8 +162,8 @@ static u32 d_can_plat_read_reg32(const struct c_can_priv *priv, enum reg index)
161162
return readl(priv->base + priv->regs[index]);
162163
}
163164

164-
static void d_can_plat_write_reg32(const struct c_can_priv *priv, enum reg index,
165-
u32 val)
165+
static void d_can_plat_write_reg32(const struct c_can_priv *priv,
166+
enum reg index, u32 val)
166167
{
167168
writel(val, priv->base + priv->regs[index]);
168169
}

drivers/net/can/dev.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,10 +553,9 @@ static void can_restart(struct net_device *dev)
553553

554554
/* send restart message upstream */
555555
skb = alloc_can_err_skb(dev, &cf);
556-
if (!skb) {
557-
err = -ENOMEM;
556+
if (!skb)
558557
goto restart;
559-
}
558+
560559
cf->can_id |= CAN_ERR_RESTARTED;
561560

562561
netif_rx(skb);

0 commit comments

Comments
 (0)