Skip to content

Commit

Permalink
can: c_can: use proper type for 'instance'
Browse files Browse the repository at this point in the history
Commit 6439fbc (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>
  • Loading branch information
Wolfram Sang authored and Marc Kleine-Budde committed Apr 24, 2014
1 parent 9394159 commit f323d7a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/net/can/c_can/c_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ struct c_can_priv {
void *priv; /* for board-specific data */
enum c_can_dev_id type;
u32 __iomem *raminit_ctrlreg;
unsigned int instance;
int instance;
void (*raminit) (const struct c_can_priv *priv, bool enable);
u32 comm_rcv_high;
u32 rxmasked;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/can/c_can/c_can_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ static int c_can_plat_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
priv->raminit_ctrlreg = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(priv->raminit_ctrlreg) || (int)priv->instance < 0)
if (IS_ERR(priv->raminit_ctrlreg) || priv->instance < 0)
dev_info(&pdev->dev, "control memory is not used for raminit\n");
else
priv->raminit = c_can_hw_raminit;
Expand Down

0 comments on commit f323d7a

Please sign in to comment.