File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -176,8 +176,9 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
176
176
return - ENODEV ;
177
177
178
178
nand_set_flash_node (& fun -> chip , flash_np );
179
- mtd -> name = kasprintf (GFP_KERNEL , "0x%llx.%pOFn" , (u64 )io_res -> start ,
180
- flash_np );
179
+ mtd -> name = devm_kasprintf (fun -> dev , GFP_KERNEL , "0x%llx.%pOFn" ,
180
+ (u64 )io_res -> start ,
181
+ flash_np );
181
182
if (!mtd -> name ) {
182
183
ret = - ENOMEM ;
183
184
goto err ;
@@ -190,8 +191,6 @@ static int fun_chip_init(struct fsl_upm_nand *fun,
190
191
ret = mtd_device_register (mtd , NULL , 0 );
191
192
err :
192
193
of_node_put (flash_np );
193
- if (ret )
194
- kfree (mtd -> name );
195
194
return ret ;
196
195
}
197
196
@@ -318,7 +317,6 @@ static int fun_remove(struct platform_device *ofdev)
318
317
ret = mtd_device_unregister (mtd );
319
318
WARN_ON (ret );
320
319
nand_cleanup (chip );
321
- kfree (mtd -> name );
322
320
323
321
for (i = 0 ; i < fun -> mchip_count ; i ++ ) {
324
322
if (fun -> rnb_gpio [i ] < 0 )
You can’t perform that action at this time.
0 commit comments