From patchwork Mon Sep 29 09:47:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 4995101 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 0E8C5BEEA6 for ; Mon, 29 Sep 2014 09:49:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 49BDF20265 for ; Mon, 29 Sep 2014 09:49:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 830C32025B for ; Mon, 29 Sep 2014 09:49:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751936AbaI2JtQ (ORCPT ); Mon, 29 Sep 2014 05:49:16 -0400 Received: from mail-we0-f176.google.com ([74.125.82.176]:50447 "EHLO mail-we0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750911AbaI2JtP (ORCPT ); Mon, 29 Sep 2014 05:49:15 -0400 Received: by mail-we0-f176.google.com with SMTP id p10so1109267wes.35 for ; Mon, 29 Sep 2014 02:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=/IilddZuXn0kYRS4qeYDBgSbDd1TBHQTTyMHIU7cFKM=; b=H7TmHcWJm9OjYSTkQAjV4gK29maLRw5x/XF9vfa35dJ+q3KUxqW6noFIArr/GxzeLM viZX43LtrHZuklvPU3eXJG6r1Ag1aITcwmY4IklS4kVGD+VvZ7JdfYHA3iEc4BryVqL2 6ll7QjRQvRHFemb7WWPwM10LSxynsxs4s6imt5jWe46cJwThBi8D7e0LYqK9iUY9kcF4 UFam3ZHoyf0tWVuFASOdLnLpoRPNGt7xz8a8o8Q9ZhnibQa1C2FR3FG4vqJSngPVVXAW LjvkPYc5aMa3rJwLR/TwPc+ghdbfJqr4ltb9nV0hy3wvk+TIHb7ARVkPVz3fUNz/qnqo O8VQ== X-Received: by 10.180.106.232 with SMTP id gx8mr12057279wib.34.1411984154390; Mon, 29 Sep 2014 02:49:14 -0700 (PDT) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id fs13sm10011559wic.19.2014.09.29.02.49.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Sep 2014 02:49:13 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: David Woodhouse , Artem Bityutskiy , Brian Norris , linux-mtd@lists.infradead.org Cc: Ben Hutchings , Hauke Mehrtens , Andrew Lunn , Jason Cooper , linux-spi , Ian Campbell , Geert Uytterhoeven , Huang Shijie , linux-arm-kernel@lists.infradead.org, debian-kernel , =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH 1/2] mtd: m25p80: get rid of spi_get_device_id Date: Mon, 29 Sep 2014 11:47:53 +0200 Message-Id: <1411984074-3850-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 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=-7.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This simplifies the way we use spi_nor framework and will allow us to drop spi_nor_match_id. Signed-off-by: Rafa? Mi?ecki --- drivers/mtd/devices/m25p80.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index dcda628..822209d 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -197,6 +197,7 @@ static int m25p_probe(struct spi_device *spi) struct m25p *flash; struct spi_nor *nor; enum read_mode mode = SPI_NOR_NORMAL; + char *flash_name = NULL; int ret; data = dev_get_platdata(&spi->dev); @@ -236,12 +237,11 @@ static int m25p_probe(struct spi_device *spi) * If that's the case, respect "type" and ignore a "name". */ if (data && data->type) - id = spi_nor_match_id(data->type); - - /* If we didn't get name from platform, simply use "modalias". */ - if (!id) - id = spi_get_device_id(spi); + flash_name = data->type; + else + flash_name = spi->modalias; + id = spi_nor_match_id(flash_name); ret = spi_nor_scan(nor, id, mode); if (ret) return ret;