Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215214
b: refs/heads/master
c: beab675
h: refs/heads/master
v: v3
  • Loading branch information
Marc Kleine-Budde committed Oct 18, 2010
1 parent e454a19 commit 916a36b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f1f8c6cbe6f08f93ac2a4ca19625891d8a82b7f8
refs/heads/master: beab675cb45f28a4a76780e43fd03e33bc773555
14 changes: 12 additions & 2 deletions trunk/drivers/net/can/mcp251x.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@ struct mcp251x_priv {
int restart_tx;
};

#define MCP251X_IS(_model) \
static inline int mcp251x_is_##_model(struct spi_device *spi) \
{ \
struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev); \
return priv->model == CAN_MCP251X_MCP##_model; \
}

MCP251X_IS(2510);
MCP251X_IS(2515);

static void mcp251x_clean(struct net_device *net)
{
struct mcp251x_priv *priv = netdev_priv(net);
Expand Down Expand Up @@ -370,7 +380,7 @@ static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf,
{
struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);

if (priv->model == CAN_MCP251X_MCP2510) {
if (mcp251x_is_2510(spi)) {
int i;

for (i = 1; i < TXBDAT_OFF + len; i++)
Expand Down Expand Up @@ -414,7 +424,7 @@ static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf,
{
struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);

if (priv->model == CAN_MCP251X_MCP2510) {
if (mcp251x_is_2510(spi)) {
int i, len;

for (i = 1; i < RXBDAT_OFF; i++)
Expand Down

0 comments on commit 916a36b

Please sign in to comment.