diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 038e59a..3026efa 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -340,7 +340,7 @@
 };
 MODULE_DEVICE_TABLE(of, xilinx_spi_of_match);
 
-static int xilinx_spi_probe(struct platform_device *dev)
+static int xilinx_spi_probe(struct platform_device *pdev)
 {
 	struct xilinx_spi *xspi;
 	struct xspi_platform_data *pdata;
@@ -350,19 +350,19 @@
 	u32 tmp;
 	u8 i;
 
-	pdata = dev->dev.platform_data;
+	pdata = pdev->dev.platform_data;
 	if (pdata) {
 		num_cs = pdata->num_chipselect;
 		bits_per_word = pdata->bits_per_word;
 	}
 
 #ifdef CONFIG_OF
-	if (dev->dev.of_node) {
+	if (pdev->dev.of_node) {
 		const __be32 *prop;
 		int len;
 
 		/* number of slave select bits is required */
-		prop = of_get_property(dev->dev.of_node, "xlnx,num-ss-bits",
+		prop = of_get_property(pdev->dev.of_node, "xlnx,num-ss-bits",
 				       &len);
 		if (prop && len >= sizeof(*prop))
 			num_cs = __be32_to_cpup(prop);
@@ -370,19 +370,20 @@
 #endif
 
 	if (!num_cs) {
-		dev_err(&dev->dev, "Missing slave select configuration data\n");
+		dev_err(&pdev->dev,
+			"Missing slave select configuration data\n");
 		return -EINVAL;
 	}
 
-	r = platform_get_resource(dev, IORESOURCE_MEM, 0);
+	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!r)
 		return -ENODEV;
 
-	irq = platform_get_irq(dev, 0);
+	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return -ENXIO;
 
-	master = spi_alloc_master(&dev->dev, sizeof(struct xilinx_spi));
+	master = spi_alloc_master(&pdev->dev, sizeof(struct xilinx_spi));
 	if (!master)
 		return -ENODEV;
 
@@ -396,15 +397,15 @@
 	xspi->bitbang.txrx_bufs = xilinx_spi_txrx_bufs;
 	init_completion(&xspi->done);
 
-	xspi->regs = devm_ioremap_resource(&dev->dev, r);
+	xspi->regs = devm_ioremap_resource(&pdev->dev, r);
 	if (IS_ERR(xspi->regs)) {
 		ret = PTR_ERR(xspi->regs);
 		goto put_master;
 	}
 
-	master->bus_num = dev->dev.id;
+	master->bus_num = pdev->dev.id;
 	master->num_chipselect = num_cs;
-	master->dev.of_node = dev->dev.of_node;
+	master->dev.of_node = pdev->dev.of_node;
 
 	xspi->mem = *r;
 	xspi->irq = irq;
@@ -453,11 +454,11 @@
 
 	ret = spi_bitbang_start(&xspi->bitbang);
 	if (ret) {
-		dev_err(&dev->dev, "spi_bitbang_start FAILED\n");
+		dev_err(&pdev->dev, "spi_bitbang_start FAILED\n");
 		goto free_irq;
 	}
 
-	dev_info(&dev->dev, "at 0x%08llX mapped to 0x%p, irq=%d\n",
+	dev_info(&pdev->dev, "at 0x%08llX mapped to 0x%p, irq=%d\n",
 		(unsigned long long)r->start, xspi->regs, xspi->irq);
 
 	if (pdata) {
@@ -465,7 +466,7 @@
 			spi_new_device(master, pdata->devices + i);
 	}
 
-	platform_set_drvdata(dev, master);
+	platform_set_drvdata(pdev, master);
 	return 0;
 
 free_irq:
@@ -476,9 +477,9 @@
 	return ret;
 }
 
-static int xilinx_spi_remove(struct platform_device *dev)
+static int xilinx_spi_remove(struct platform_device *pdev)
 {
-	struct spi_master *master = platform_get_drvdata(dev);
+	struct spi_master *master = platform_get_drvdata(pdev);
 	struct xilinx_spi *xspi = spi_master_get_devdata(master);
 
 	spi_bitbang_stop(&xspi->bitbang);
