diff options
author | Damian Hobson-Garcia <dhobsong@igel.co.jp> | 2012-11-16 00:46:12 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-21 16:44:10 -0500 |
commit | d5185c4eb3a022f7e7a435238c2b0b885e6b4821 (patch) | |
tree | aece700c34a2f5af161740a2e85a756040dd557a | |
parent | 439926c81c01f31f9ffa7af7bf2d242b7f794f3c (diff) |
drivers: uio: Only allocate new private data when probing device tree node
The same condition should be used both when allocating and freeing the
driver private data. When dev.of_node is non NULL, allocate a new
private data structure, otherwise use the values from the platform data.
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/uio/uio_dmem_genirq.c | 2 | ||||
-rw-r--r-- | drivers/uio/uio_pdrv_genirq.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/uio/uio_dmem_genirq.c b/drivers/uio/uio_dmem_genirq.c index bbdf92559e3f..252434c9ea9d 100644 --- a/drivers/uio/uio_dmem_genirq.c +++ b/drivers/uio/uio_dmem_genirq.c | |||
@@ -153,7 +153,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) | |||
153 | int ret = -EINVAL; | 153 | int ret = -EINVAL; |
154 | int i; | 154 | int i; |
155 | 155 | ||
156 | if (!uioinfo) { | 156 | if (pdev->dev.of_node) { |
157 | int irq; | 157 | int irq; |
158 | 158 | ||
159 | /* alloc uioinfo for one device */ | 159 | /* alloc uioinfo for one device */ |
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c index ac988ce62f2b..c122bca669b6 100644 --- a/drivers/uio/uio_pdrv_genirq.c +++ b/drivers/uio/uio_pdrv_genirq.c | |||
@@ -102,7 +102,7 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev) | |||
102 | int ret = -EINVAL; | 102 | int ret = -EINVAL; |
103 | int i; | 103 | int i; |
104 | 104 | ||
105 | if (!uioinfo) { | 105 | if (pdev->dev.of_node) { |
106 | int irq; | 106 | int irq; |
107 | 107 | ||
108 | /* alloc uioinfo for one device */ | 108 | /* alloc uioinfo for one device */ |