mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lothar Waßmann" <LW@KARO-electronics.de>
To: Mark Brown <broonie@kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Benoit Cousson <bcousson@baylibre.com>,
	Shubhrajyoti D <shubhrajyoti@ti.com>, Charulatha V <charu@ti.com>
Cc: "Lothar Waßmann" <LW@KARO-electronics.de>
Subject: [PATCH] spi: omap2-mcspi: fix blatant abuse of the resource subsystem
Date: Fri, 18 Jul 2014 13:30:53 +0200	[thread overview]
Message-ID: <1405683053-14104-1-git-send-email-LW@KARO-electronics.de> (raw)

Aua. This really hurts. I wonder how this could ever be admitted to
the Linux kernel...
Further comments suppressed because the would most likely violate the
CDA.

If someone should not grasp what this patch does, they should consider
what happens upon unloading/reloading the kernel module.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
---
 drivers/spi/spi-omap2-mcspi.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 68441fa..cb23f5d 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1379,15 +1379,13 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
 		goto free_master;
 	}
 
-	r->start += regs_offset;
-	r->end += regs_offset;
-	mcspi->phys = r->start;
-
 	mcspi->base = devm_ioremap_resource(&pdev->dev, r);
 	if (IS_ERR(mcspi->base)) {
 		status = PTR_ERR(mcspi->base);
 		goto free_master;
 	}
+	mcspi->phys = r->start + regs_offset;
+	mcspi->base += regs_offset;
 
 	mcspi->dev = &pdev->dev;
 
-- 
1.7.10.4


             reply	other threads:[~2014-07-18 11:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-18 11:30 Lothar Waßmann [this message]
2014-07-18 17:10 ` Mark Brown
2014-07-21  5:51   ` Lothar Waßmann
2014-07-21 12:18     ` Mark Brown
2014-07-21 12:41       ` Lothar Waßmann
2014-07-21 15:44         ` Mark Brown
2016-10-04  9:27 ` Applied "spi: omap2-mcspi: Fix modifying platform resource data" to the spi tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405683053-14104-1-git-send-email-LW@KARO-electronics.de \
    --to=lw@karo-electronics.de \
    --cc=bcousson@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=charu@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=shubhrajyoti@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®