Skip to content

Commit

Permalink
i2c: ocores: Fix pointer to integer cast warning
Browse files Browse the repository at this point in the history
After commit a000b8c [i2c: ocores: Add support for the GRLIB port of the
controller and use function pointers for getreg and setreg function],
compiling i2c-ocores.c for 64-bit gives the following warning:

  drivers/i2c/busses/i2c-ocores.c: In function 'ocores_i2c_of_probe':
  drivers/i2c/busses/i2c-ocores.c:334:15: warning: cast from pointer to integer of different size

Fix it by casting the pointer to long.

Signed-off-by: Jayachandran C <jchandra@broadcom.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Jayachandran C authored and Wolfram Sang committed Feb 21, 2013
1 parent 58823c7 commit 6beaddf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-ocores.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ static int ocores_i2c_of_probe(struct platform_device *pdev,
&i2c->reg_io_width);

match = of_match_node(ocores_i2c_match, pdev->dev.of_node);
if (match && (int)match->data == TYPE_GRLIB) {
if (match && (long)match->data == TYPE_GRLIB) {
dev_dbg(&pdev->dev, "GRLIB variant of i2c-ocores\n");
i2c->setreg = oc_setreg_grlib;
i2c->getreg = oc_getreg_grlib;
Expand Down

0 comments on commit 6beaddf

Please sign in to comment.