Skip to content

Commit

Permalink
drivers: uio: Only allocate new private data when probing device tree…
Browse files Browse the repository at this point in the history
… 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>
  • Loading branch information
Damian Hobson-Garcia authored and Greg Kroah-Hartman committed Nov 21, 2012
1 parent 439926c commit d5185c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/uio/uio_dmem_genirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ static int uio_dmem_genirq_probe(struct platform_device *pdev)
int ret = -EINVAL;
int i;

if (!uioinfo) {
if (pdev->dev.of_node) {
int irq;

/* alloc uioinfo for one device */
Expand Down
2 changes: 1 addition & 1 deletion drivers/uio/uio_pdrv_genirq.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
int ret = -EINVAL;
int i;

if (!uioinfo) {
if (pdev->dev.of_node) {
int irq;

/* alloc uioinfo for one device */
Expand Down

0 comments on commit d5185c4

Please sign in to comment.