[PATCH 1/2] staging: kpc2000_spi: eliminated duplicate initialization of drvdata local variable.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



drvdata was being initialized to a particular value and then
having the same value assigned to it immediately afterwards.  Removed
the initializer.

Since the value assigned, pldev->dev.platform_data, is a pointer-to-
void, removed superfluous cast.

Signed-off-by: Jeremy Sowden <jeremy@xxxxxxxxxx>
---
 drivers/staging/kpc2000/kpc_spi/spi_driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/kpc2000/kpc_spi/spi_driver.c b/drivers/staging/kpc2000/kpc_spi/spi_driver.c
index 63b4616bf538..e77f04bf02d9 100644
--- a/drivers/staging/kpc2000/kpc_spi/spi_driver.c
+++ b/drivers/staging/kpc2000/kpc_spi/spi_driver.c
@@ -407,14 +407,14 @@ kp_spi_cleanup(struct spi_device *spidev)
 static int
 kp_spi_probe(struct platform_device *pldev)
 {
-    struct kpc_core_device_platdata *drvdata = (struct kpc_core_device_platdata *)pldev->dev.platform_data;
+    struct kpc_core_device_platdata *drvdata;
     struct spi_master *master = spi_alloc_master(&pldev->dev, sizeof(struct kp_spi));
     struct kp_spi *kpspi;
     struct resource *r;
     int status = 0;
     int i;
 
-    drvdata = (struct kpc_core_device_platdata *)pldev->dev.platform_data;
+    drvdata = pldev->dev.platform_data;
     if (!drvdata){
         dev_err(&pldev->dev, "kp_spi_probe: platform_data is NULL!\n");
         return -ENODEV;
-- 
2.20.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux