From patchwork Fri Jul 18 11:30:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lothar_Wa=C3=9Fmann?= X-Patchwork-Id: 4582631 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1503C0514 for ; Fri, 18 Jul 2014 11:31:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E833E2011E for ; Fri, 18 Jul 2014 11:31:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 05DF62011D for ; Fri, 18 Jul 2014 11:31:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755311AbaGRLbN (ORCPT ); Fri, 18 Jul 2014 07:31:13 -0400 Received: from mail.karo-electronics.de ([81.173.242.67]:56869 "EHLO mail.karo-electronics.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753153AbaGRLbN (ORCPT ); Fri, 18 Jul 2014 07:31:13 -0400 From: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= To: Mark Brown , , , , Benoit Cousson , Shubhrajyoti D , Charulatha V Cc: =?UTF-8?q?Lothar=20Wa=C3=9Fmann?= Subject: [PATCH] spi: omap2-mcspi: fix blatant abuse of the resource subsystem Date: Fri, 18 Jul 2014 13:30:53 +0200 Message-Id: <1405683053-14104-1-git-send-email-LW@KARO-electronics.de> X-Mailer: git-send-email 1.7.10.4 MIME-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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;