| From dhobsong@igel.co.jp Wed Nov 21 18:27:25 2012 |
| From: Damian Hobson-Garcia <dhobsong@igel.co.jp> |
| Date: Thu, 22 Nov 2012 11:26:53 +0900 |
| Subject: [PATCH 6/6] drivers: uio: Only allocate new private data when probing device tree node |
| To: gregkh@linuxfoundation.org |
| Cc: ltsi-dev@lists.linuxfoundation.org, Damian Hobson-Garcia <dhobsong@igel.co.jp> |
| Message-ID: <1353551213-17996-7-git-send-email-dhobsong@igel.co.jp> |
| |
| |
| 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> |
| --- |
| drivers/uio/uio_dmem_genirq.c | 2 +- |
| drivers/uio/uio_pdrv_genirq.c | 2 +- |
| 2 files changed, 2 insertions(+), 2 deletions(-) |
| |
| --- 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 |
| int ret = -EINVAL; |
| int i; |
| |
| - if (!uioinfo) { |
| + if (pdev->dev.of_node) { |
| int irq; |
| |
| /* alloc uioinfo for one device */ |
| --- 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 |
| int ret = -EINVAL; |
| int i; |
| |
| - if (!uioinfo) { |
| + if (pdev->dev.of_node) { |
| int irq; |
| |
| /* alloc uioinfo for one device */ |