From patchwork Fri Feb 3 23:31:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamal Dasu X-Patchwork-Id: 723969 X-Patchwork-Delegate: cyrille.pitchen@atmel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vFY8m3j2Bz9s77 for ; Sat, 4 Feb 2017 10:33:44 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="L/azaXW+"; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cZnMM-0005l3-IH; Fri, 03 Feb 2017 23:33:42 +0000 Received: from mail-qt0-f195.google.com ([209.85.216.195]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZnLn-0004pD-A1 for linux-mtd@lists.infradead.org; Fri, 03 Feb 2017 23:33:09 +0000 Received: by mail-qt0-f195.google.com with SMTP id s58so7709770qtc.2 for ; Fri, 03 Feb 2017 15:32:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PFOw8PRnB8EFTz3dX2+WBETD4UPHpvt7V5YTgpY7AL4=; b=L/azaXW+hqmf0vVIWvnJeLL+z1MdMl2lYmIxm/TZXhsPoFDVlfSPvjNaTxt/s8drz9 H5KGbVB1MEsMvnZEgOzgZyE0McNfg1qHDFpi0q4Wqyr+b8wUz57/VQ6lk3qBZGDybU2w H4ekECQuAaNzGOVYMAN8E5LFJqnhSGgKrsaSirT21z3oMU9ajSOq0X1ExuT9WDw9RUru qqnmArp1LE83CQ3LYC2iCFfPPGQAFEvTTN5hicznXaJwPL99YQrQvyXRS1O+EqHNeuPj yDo3xHf2mHtRpQAgkSwPilYL/6OOuZpFb2N2MOHjVLEXU28y7M7miA0CUu2DpfaA8l+U fw1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PFOw8PRnB8EFTz3dX2+WBETD4UPHpvt7V5YTgpY7AL4=; b=ZQBs9vZrOcPGWWCXWBXaCk9kzcb9Kyoeoilt2hDGziwHh8IGKOqNP1w3E7cqxu1EY+ omKrXyNMdpn52zHxdM8rquKsDeVXQvk/OA67bwCW/9DRTlEnSAlLmLqBp+ogzsh+STWw 8hA7z0I9rFxK5IxTkQ0I+yU1tWJO/QZa10RLGzHAFfu2t5TwuoNYi56s5QVeBQxawid0 JnQvz3xzGqL/PfoT4czL0guuxmUIH7c15A1wDzO7Cxe3Mz6DIXP/nmMUvqZt7lyq5SrT AJ5wGWepLBJiF4NPrUp3I+E9p+3AXATmGraVyyaoEinITXJnceptwSLKpFh3aWnkkLLb acTA== X-Gm-Message-State: AIkVDXJRo0SkSAZnnQrE2CoURtunk6nWEp6m1LslI+3yWZdlnEjwjQO8phR/y3AzK360PQ== X-Received: by 10.55.105.71 with SMTP id e68mr15618509qkc.307.1486164706075; Fri, 03 Feb 2017 15:31:46 -0800 (PST) Received: from mail.broadcom.com ([192.19.218.250]) by smtp.gmail.com with ESMTPSA id 140sm25747914qkj.19.2017.02.03.15.31.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 03 Feb 2017 15:31:45 -0800 (PST) From: Kamal Dasu To: linux-spi@vger.kernel.org, cyrille.pitchen@atmel.com, marex@denx.de, broonie@kernel.org Subject: [PATCH v1 4/5] mtd: m25p80: Check if the spi flash device has pm support Date: Fri, 3 Feb 2017 18:31:15 -0500 Message-Id: <1486164676-12912-5-git-send-email-kdasu.kdev@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1486164676-12912-1-git-send-email-kdasu.kdev@gmail.com> References: <1486164676-12912-1-git-send-email-kdasu.kdev@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170203_153307_488724_3ADB707A X-CRM114-Status: GOOD ( 10.42 ) X-Spam-Score: -2.2 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.216.195 listed in dnsbl.sorbs.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.216.195 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.216.195 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (kdasu.kdev[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: bcm-kernel-feedback-list@broadcom.com, f.fainelli@gmail.com, linux-mtd@lists.infradead.org, Kamal Dasu MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Call the spi_nor_rescan() only if the controller driver needs this support. This way SoCs that need this feature can use it. Signed-off-by: Kamal Dasu --- drivers/mtd/devices/m25p80.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 4528e33..ffdec60 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c @@ -328,8 +328,13 @@ static int m25p_suspend(struct device *dev) static int m25p_resume(struct device *dev) { struct m25p *flash = dev_get_drvdata(dev); + struct spi_device *spi = flash->spi; + int ret = 0; + + if (spi_flash_pm_supported(spi)) + ret = spi_nor_pm_rescan(&flash->spi_nor, NULL); - return spi_nor_pm_rescan(&flash->spi-nor, NULL); + return ret; } #endif static SIMPLE_DEV_PM_OPS(m25p_pm_ops, m25p_suspend, m25p_resume);