File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
11
11
#include <linux/bitmap.h>
12
+ #include <linux/cleanup.h>
12
13
#include <linux/clk.h>
13
14
#include <linux/device.h>
14
15
#include <linux/interrupt.h>
@@ -348,19 +349,18 @@ static void sun8i_ths_reset_control_assert(void *data)
348
349
349
350
static struct regmap * sun8i_ths_get_sram_regmap (struct device_node * node )
350
351
{
351
- struct device_node * sram_node ;
352
352
struct platform_device * sram_pdev ;
353
353
struct regmap * regmap = NULL ;
354
354
355
- sram_node = of_parse_phandle (node , "allwinner,sram" , 0 );
355
+ struct device_node * sram_node __free (device_node ) =
356
+ of_parse_phandle (node , "allwinner,sram" , 0 );
356
357
if (!sram_node )
357
358
return ERR_PTR (- ENODEV );
358
359
359
360
sram_pdev = of_find_device_by_node (sram_node );
360
361
if (!sram_pdev ) {
361
362
/* platform device might not be probed yet */
362
- regmap = ERR_PTR (- EPROBE_DEFER );
363
- goto out_put_node ;
363
+ return ERR_PTR (- EPROBE_DEFER );
364
364
}
365
365
366
366
/* If no regmap is found then the other device driver is at fault */
@@ -369,8 +369,7 @@ static struct regmap *sun8i_ths_get_sram_regmap(struct device_node *node)
369
369
regmap = ERR_PTR (- EINVAL );
370
370
371
371
platform_device_put (sram_pdev );
372
- out_put_node :
373
- of_node_put (sram_node );
372
+
374
373
return regmap ;
375
374
}
376
375
You can’t perform that action at this time.
0 commit comments