From 0e1c78a7efd5262899c7be025db79bad26fe0e48 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Mon, 3 Sep 2012 10:14:29 +0200 Subject: [PATCH] --- yaml --- r: 328603 b: refs/heads/master c: b4b8482690d97ea5421acf71e9e397fe0c5a25b8 h: refs/heads/master i: 328601: 8fe236da51b808b7113ae13f81afd0b095ced6ec 328599: da88b9919f167a9e9c879159fc2b5eb7e73a1ea5 v: v3 --- [refs] | 2 +- trunk/drivers/spi/spi-pl022.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index ec6b93467191..2a131b35c019 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 38e271cde5ae62b0b94ff8e8e7e1e1395da7dbf5 +refs/heads/master: b4b8482690d97ea5421acf71e9e397fe0c5a25b8 diff --git a/trunk/drivers/spi/spi-pl022.c b/trunk/drivers/spi/spi-pl022.c index 959f2acff2d3..827ad5152d8b 100644 --- a/trunk/drivers/spi/spi-pl022.c +++ b/trunk/drivers/spi/spi-pl022.c @@ -2053,8 +2053,7 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) } /* Allocate master with space for data */ - master = spi_alloc_master(dev, sizeof(struct pl022) + sizeof(int) * - num_cs); + master = spi_alloc_master(dev, sizeof(struct pl022)); if (master == NULL) { dev_err(&adev->dev, "probe - cannot alloc SPI master\n"); status = -ENOMEM; @@ -2066,8 +2065,8 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) pl022->master_info = platform_info; pl022->adev = adev; pl022->vendor = id->data; - /* Point chipselects to allocated memory beyond the main struct */ - pl022->chipselects = (int *) pl022 + sizeof(struct pl022); + pl022->chipselects = devm_kzalloc(dev, num_cs * sizeof(int), + GFP_KERNEL); /* * Bus Number Which has been Assigned to this SSP controller