提交 d5185c4e 编写于 作者: D Damian Hobson-Garcia 提交者: Greg Kroah-Hartman

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: NFengguang Wu <fengguang.wu@intel.com>
Signed-off-by: NDamian Hobson-Garcia <dhobsong@igel.co.jp>
Cc: "Hans J. Koch" <hjk@hansjkoch.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 439926c8
...@@ -153,7 +153,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev) ...@@ -153,7 +153,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
int ret = -EINVAL; int ret = -EINVAL;
int i; int i;
if (!uioinfo) { if (pdev->dev.of_node) {
int irq; int irq;
/* alloc uioinfo for one device */ /* alloc uioinfo for one device */
......
...@@ -102,7 +102,7 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev) ...@@ -102,7 +102,7 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
int ret = -EINVAL; int ret = -EINVAL;
int i; int i;
if (!uioinfo) { if (pdev->dev.of_node) {
int irq; int irq;
/* alloc uioinfo for one device */ /* alloc uioinfo for one device */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册