mtd: m25p80: remove 'disabled' device check

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Wed Nov 13 13:59:05 EST 2013


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=dc525ff4705cee2291b1637a650489aca86ac937
Commit:     dc525ff4705cee2291b1637a650489aca86ac937
Parent:     ddba7c5ad797f4b878f4e177ef300c1f9837cd29
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Wed Oct 23 19:34:46 2013 -0700
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Wed Nov 6 23:33:06 2013 -0800

    mtd: m25p80: remove 'disabled' device check
    
    It seems like the following commit was never necessary
    
        commit 5f949137952020214cd167093dd7be448f21c079
        Author: Shaohui Xie <Shaohui.Xie at freescale.com>
        Date:   Fri Oct 14 15:49:00 2011 +0800
    
            mtd: m25p80: don't probe device which has status of 'disabled'
    
    because it duplicates the code in of_platform_device_create_pdata()
    which ensures that 'disabled' nodes are never instantiated.
    
    Also, drop the __maybe_unused.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Reviewed-by: Sourav Poddar <sourav.poddar at ti.com>
    Reviewed-by: Grant Likely <grant.likely at linaro.org>
    Cc: Rob Herring <rob.herring at calxeda.com>
    Cc: <devicetree at vger.kernel.org>
---
 drivers/mtd/devices/m25p80.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c
index d6c5c57..a1dc49a 100644
--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -935,12 +935,7 @@ static int m25p_probe(struct spi_device *spi)
 	struct flash_info		*info;
 	unsigned			i;
 	struct mtd_part_parser_data	ppdata;
-	struct device_node __maybe_unused *np = spi->dev.of_node;
-
-#ifdef CONFIG_MTD_OF_PARTS
-	if (!of_device_is_available(np))
-		return -ENODEV;
-#endif
+	struct device_node *np = spi->dev.of_node;
 
 	/* Platform data helps sort out which chip type we have, as
 	 * well as how this board partitions it.  If we don't have



More information about the linux-mtd-cvs mailing list