diff options
author | Wolfram Sang <wsa@sang-engineering.com> | 2014-04-17 04:57:18 -0400 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2014-04-24 16:09:01 -0400 |
commit | f323d7a1d2868c00b2604dca36ad82e8ecbe4270 (patch) | |
tree | d4db44e61e0d6a6197e47aa74b567f9b034d7608 /drivers/net | |
parent | 939415973fdfb2c16a474e2575ba2581b828ccac (diff) |
can: c_can: use proper type for 'instance'
Commit 6439fbce1075 (can: c_can: fix error checking of priv->instance in
probe()) found the warning but applied a suboptimal solution. Since, both
pdev->id and of_alias_get_id() return integers, it makes sense to convert the
variable to an integer and avoid the cast.
Signed-off-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/can/c_can/c_can.h | 2 | ||||
-rw-r--r-- | drivers/net/can/c_can/c_can_platform.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/c_can/c_can.h b/drivers/net/can/c_can/c_can.h index e7de2b9f26bb..c56f1b1c11ca 100644 --- a/drivers/net/can/c_can/c_can.h +++ b/drivers/net/can/c_can/c_can.h | |||
@@ -183,7 +183,7 @@ struct c_can_priv { | |||
183 | void *priv; /* for board-specific data */ | 183 | void *priv; /* for board-specific data */ |
184 | enum c_can_dev_id type; | 184 | enum c_can_dev_id type; |
185 | u32 __iomem *raminit_ctrlreg; | 185 | u32 __iomem *raminit_ctrlreg; |
186 | unsigned int instance; | 186 | int instance; |
187 | void (*raminit) (const struct c_can_priv *priv, bool enable); | 187 | void (*raminit) (const struct c_can_priv *priv, bool enable); |
188 | u32 comm_rcv_high; | 188 | u32 comm_rcv_high; |
189 | u32 rxmasked; | 189 | u32 rxmasked; |
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 806d92753427..1df0b322d1e4 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c | |||
@@ -222,7 +222,7 @@ static int c_can_plat_probe(struct platform_device *pdev) | |||
222 | 222 | ||
223 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 223 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
224 | priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res); | 224 | priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res); |
225 | if (IS_ERR(priv->raminit_ctrlreg) || (int)priv->instance < 0) | 225 | if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0) |
226 | dev_info(&pdev->dev, "control memory is not used for raminit\n"); | 226 | dev_info(&pdev->dev, "control memory is not used for raminit\n"); |
227 | else | 227 | else |
228 | priv->raminit = c_can_hw_raminit; | 228 | priv->raminit = c_can_hw_raminit; |