Skip to content

Commit

Permalink
can: mark bittiming_const pointer in struct can_priv as const
Browse files Browse the repository at this point in the history
This patch marks the bittiming_const pointer as in the struct can_pric as
"const". This allows us to mark the struct can_bittiming_const in the CAN
drivers as "const", too.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Marc Kleine-Budde committed Jul 20, 2012
1 parent 769162e commit 194b9a4
Showing 15 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion drivers/net/can/at91_can.c
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion drivers/net/can/bfin_can.c
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion drivers/net/can/c_can/c_can.c
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion drivers/net/can/cc770/cc770.c
Original file line number Diff line number Diff line change
@@ -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,
2 changes: 1 addition & 1 deletion drivers/net/can/flexcan.c
Original file line number Diff line number Diff line change
@@ -203,7 +203,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,
2 changes: 1 addition & 1 deletion drivers/net/can/janz-ican3.c
Original file line number Diff line number Diff line change
@@ -1490,7 +1490,7 @@ static const struct net_device_ops ican3_netdev_ops = {
*/

/* This structure was stolen from drivers/net/can/sja1000/sja1000.c */
static struct can_bittiming_const ican3_bittiming_const = {
static const struct can_bittiming_const ican3_bittiming_const = {
.name = DRV_NAME,
.tseg1_min = 1,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
@@ -214,7 +214,7 @@ static int mcp251x_enable_dma; /* Enable SPI DMA. Default: 0 (Off) */
module_param(mcp251x_enable_dma, int, S_IRUGO);
MODULE_PARM_DESC(mcp251x_enable_dma, "Enable SPI DMA. Default: 0 (Off)");

static struct can_bittiming_const mcp251x_bittiming_const = {
static const struct can_bittiming_const mcp251x_bittiming_const = {
.name = DEVICE_NAME,
.tseg1_min = 3,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/mscan/mscan.c
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@

#include "mscan.h"

static struct can_bittiming_const mscan_bittiming_const = {
static const struct can_bittiming_const mscan_bittiming_const = {
.name = "mscan",
.tseg1_min = 4,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/pch_can.c
Original file line number Diff line number Diff line change
@@ -184,7 +184,7 @@ struct pch_can_priv {
int use_msi;
};

static struct can_bittiming_const pch_can_bittiming_const = {
static const struct can_bittiming_const pch_can_bittiming_const = {
.name = KBUILD_MODNAME,
.tseg1_min = 2,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/sja1000/sja1000.c
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");
MODULE_LICENSE("Dual BSD/GPL");
MODULE_DESCRIPTION(DRV_NAME "CAN netdevice driver");

static struct can_bittiming_const sja1000_bittiming_const = {
static const struct can_bittiming_const sja1000_bittiming_const = {
.name = DRV_NAME,
.tseg1_min = 1,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/ti_hecc.c
Original file line number Diff line number Diff line change
@@ -196,7 +196,7 @@ MODULE_VERSION(HECC_MODULE_VERSION);
#define HECC_CANGIM_SIL BIT(2) /* system interrupts to int line 1 */

/* CAN Bittiming constants as per HECC specs */
static struct can_bittiming_const ti_hecc_bittiming_const = {
static const struct can_bittiming_const ti_hecc_bittiming_const = {
.name = DRV_NAME,
.tseg1_min = 1,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/usb/ems_usb.c
Original file line number Diff line number Diff line change
@@ -889,7 +889,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
.ndo_start_xmit = ems_usb_start_xmit,
};

static struct can_bittiming_const ems_usb_bittiming_const = {
static const struct can_bittiming_const ems_usb_bittiming_const = {
.name = "ems_usb",
.tseg1_min = 1,
.tseg1_max = 16,
2 changes: 1 addition & 1 deletion drivers/net/can/usb/esd_usb2.c
Original file line number Diff line number Diff line change
@@ -871,7 +871,7 @@ static const struct net_device_ops esd_usb2_netdev_ops = {
.ndo_start_xmit = esd_usb2_start_xmit,
};

static struct can_bittiming_const esd_usb2_bittiming_const = {
static const struct can_bittiming_const esd_usb2_bittiming_const = {
.name = "esd_usb2",
.tseg1_min = ESD_USB2_TSEG1_MIN,
.tseg1_max = ESD_USB2_TSEG1_MAX,
2 changes: 1 addition & 1 deletion drivers/net/can/usb/peak_usb/pcan_usb_core.h
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ struct peak_usb_adapter {
char *name;
u32 device_id;
struct can_clock clock;
struct can_bittiming_const bittiming_const;
const struct can_bittiming_const bittiming_const;
unsigned int ctrl_count;

int (*intf_probe)(struct usb_interface *intf);
2 changes: 1 addition & 1 deletion include/linux/can/dev.h
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ struct can_priv {
struct can_device_stats can_stats;

struct can_bittiming bittiming;
struct can_bittiming_const *bittiming_const;
const struct can_bittiming_const *bittiming_const;
struct can_clock clock;

enum can_state state;

0 comments on commit 194b9a4

Please sign in to comment.