mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
staging: axis-fifo: remove unnecessary dev_set_drvdata() calls
Remove unnecessary dev_set_drvdata() calls - driver_data will be set to NULL in device_unbind_cleanup() at driver exit time. This allows us to remove the 'err_initial' label, simplifying the probe function a bit. Signed-off-by: Ovidiu Panait <ovidiu.panait.oss@gmail.com> Link: https://lore.kernel.org/r/20250808204831.2618122-1-ovidiu.panait.oss@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
498a14ce8e
commit
5f5743e5b5
|
|
@ -693,10 +693,8 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
|||
|
||||
/* get iospace for the device and request physical memory */
|
||||
fifo->base_addr = devm_platform_get_and_ioremap_resource(pdev, 0, &r_mem);
|
||||
if (IS_ERR(fifo->base_addr)) {
|
||||
rc = PTR_ERR(fifo->base_addr);
|
||||
goto err_initial;
|
||||
}
|
||||
if (IS_ERR(fifo->base_addr))
|
||||
return PTR_ERR(fifo->base_addr);
|
||||
|
||||
dev_dbg(fifo->dt_device, "remapped memory to 0x%p\n", fifo->base_addr);
|
||||
|
||||
|
|
@ -711,7 +709,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
|||
|
||||
rc = axis_fifo_parse_dt(fifo);
|
||||
if (rc)
|
||||
goto err_initial;
|
||||
return rc;
|
||||
|
||||
reset_ip_core(fifo);
|
||||
|
||||
|
|
@ -723,7 +721,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
|||
/* get IRQ resource */
|
||||
rc = platform_get_irq(pdev, 0);
|
||||
if (rc < 0)
|
||||
goto err_initial;
|
||||
return rc;
|
||||
|
||||
/* request IRQ */
|
||||
fifo->irq = rc;
|
||||
|
|
@ -732,7 +730,7 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
|||
if (rc) {
|
||||
dev_err(fifo->dt_device, "couldn't allocate interrupt %i\n",
|
||||
fifo->irq);
|
||||
goto err_initial;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* ----------------------------
|
||||
|
|
@ -747,15 +745,11 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
|||
fifo->miscdev.parent = dev;
|
||||
rc = misc_register(&fifo->miscdev);
|
||||
if (rc < 0)
|
||||
goto err_initial;
|
||||
return rc;
|
||||
|
||||
axis_fifo_debugfs_init(fifo);
|
||||
|
||||
return 0;
|
||||
|
||||
err_initial:
|
||||
dev_set_drvdata(dev, NULL);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static void axis_fifo_remove(struct platform_device *pdev)
|
||||
|
|
@ -765,7 +759,6 @@ static void axis_fifo_remove(struct platform_device *pdev)
|
|||
|
||||
debugfs_remove(fifo->debugfs_dir);
|
||||
misc_deregister(&fifo->miscdev);
|
||||
dev_set_drvdata(dev, NULL);
|
||||
}
|
||||
|
||||
static const struct of_device_id axis_fifo_of_match[] = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user