Simplify driver probe and release function.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
devm_iounmap(dev, drvdata->regs);
err_region:
devm_iounmap(dev, drvdata->regs);
err_region:
dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
#endif
dcr_unmap(drvdata->dcr_host, drvdata->dcr_len);
#endif
pdata = xilinx_fb_default_pdata;
/* Allocate the driver data region */
pdata = xilinx_fb_default_pdata;
/* Allocate the driver data region */
- drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
- if (!drvdata) {
- dev_err(&pdev->dev, "Couldn't allocate device private record\n");
+ drvdata = devm_kzalloc(&pdev->dev, sizeof(*drvdata), GFP_KERNEL);
+ if (!drvdata)
/*
* To check whether the core is connected directly to DCR or BUS
/*
* To check whether the core is connected directly to DCR or BUS
drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
if (!DCR_MAP_OK(drvdata->dcr_host)) {
dev_err(&op->dev, "invalid DCR address\n");
drvdata->dcr_host = dcr_map(op->dev.of_node, start, drvdata->dcr_len);
if (!DCR_MAP_OK(drvdata->dcr_host)) {
dev_err(&op->dev, "invalid DCR address\n");