Skip to content

Commit

Permalink
spi/atmel: Fix pointer to int conversion warnings on 64 bit builds
Browse files Browse the repository at this point in the history
On 64 bit systems integers are generally still 32 bit but long values and
pointers are usually 64 bit. GCC warns when casting a 64 bit pointer into
a 32 bit integer so cast to a long instead in order to avoid warnings.

Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Mark Brown committed Aug 1, 2014
1 parent ef40eb3 commit 67f08d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-atmel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ static int atmel_spi_setup(struct spi_device *spi)
csr |= SPI_BF(DLYBCT, 0);

/* chipselect must have been muxed as GPIO (e.g. in board setup) */
npcs_pin = (unsigned int)spi->controller_data;
npcs_pin = (unsigned long)spi->controller_data;

if (gpio_is_valid(spi->cs_gpio))
npcs_pin = spi->cs_gpio;
Expand Down Expand Up @@ -1247,7 +1247,7 @@ static int atmel_spi_transfer_one_message(struct spi_master *master,
static void atmel_spi_cleanup(struct spi_device *spi)
{
struct atmel_spi_device *asd = spi->controller_state;
unsigned gpio = (unsigned) spi->controller_data;
unsigned gpio = (unsigned long) spi->controller_data;

if (!asd)
return;
Expand Down

0 comments on commit 67f08d6

Please sign in to comment.