public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xilinx systemace: Fix device name assignment for SystemACE (from "xs`" to "xsa").
@ 2013-05-23 12:31 Michal Simek
  2013-05-23 12:31 ` [PATCH 2/2] xilinx systemace: Fix sparse warnings Michal Simek
  2013-06-03 12:47 ` [PATCH 1/2] xilinx systemace: Fix device name assignment for SystemACE (from "xs`" to "xsa") Michal Simek
  0 siblings, 2 replies; 7+ messages in thread
From: Michal Simek @ 2013-05-23 12:31 UTC (permalink / raw)
  To: linux-kernel
  Cc: Michal Simek, Michal Simek, Graeme Smecher, Greg Kroah-Hartman,
	Grant Likely, Al Viro

[-- Attachment #1: Type: text/plain, Size: 1154 bytes --]

From: Graeme Smecher <gsmecher@threespeedlogic.com>

This fixes a bug introduced in 5d10302f46d, where device trees that don't
provide the "port-number" attribute are mistakenly assigned the device "xs`".
The error check that's supposed to assign a default letter can't succeed,
since it tests an unsigned type against a negative return code.

Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
 drivers/block/xsysace.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index f8ef15f..3fd130f 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -1160,8 +1160,7 @@ static int ace_probe(struct platform_device *dev)
 	dev_dbg(&dev->dev, "ace_probe(%p)\n", dev);

 	/* device id and bus width */
-	of_property_read_u32(dev->dev.of_node, "port-number", &id);
-	if (id < 0)
+	if (of_property_read_u32(dev->dev.of_node, "port-number", &id))
 		id = 0;
 	if (of_find_property(dev->dev.of_node, "8-bit", NULL))
 		bus_width = ACE_BUS_WIDTH_8;
--
1.8.2.3


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-06-10  8:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-23 12:31 [PATCH 1/2] xilinx systemace: Fix device name assignment for SystemACE (from "xs`" to "xsa") Michal Simek
2013-05-23 12:31 ` [PATCH 2/2] xilinx systemace: Fix sparse warnings Michal Simek
2013-06-03 12:47 ` [PATCH 1/2] xilinx systemace: Fix device name assignment for SystemACE (from "xs`" to "xsa") Michal Simek
2013-06-03 14:22   ` Greg Kroah-Hartman
2013-06-03 14:33     ` Michal Simek
2013-06-03 14:37       ` Greg Kroah-Hartman
2013-06-10  8:59         ` Michal Simek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox