File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -703,27 +703,25 @@ static int ls1x_nand_chip_init(struct ls1x_nand_host *host)
703
703
if (!chip_np )
704
704
return dev_err_probe (dev , - ENODEV , "failed to get child node for NAND chip\n" );
705
705
706
- chip -> controller = & host -> controller ;
707
- chip -> options = NAND_NO_SUBPAGE_WRITE | NAND_USES_DMA | NAND_BROKEN_XD ;
708
- chip -> buf_align = 16 ;
709
- nand_set_controller_data (chip , host );
710
706
nand_set_flash_node (chip , chip_np );
707
+ of_node_put (chip_np );
711
708
if (!mtd -> name )
712
709
return dev_err_probe (dev , - EINVAL , "Missing MTD label\n" );
713
710
711
+ nand_set_controller_data (chip , host );
712
+ chip -> controller = & host -> controller ;
713
+ chip -> options = NAND_NO_SUBPAGE_WRITE | NAND_USES_DMA | NAND_BROKEN_XD ;
714
+ chip -> buf_align = 16 ;
714
715
mtd -> dev .parent = dev ;
715
716
mtd -> owner = THIS_MODULE ;
716
717
717
718
ret = nand_scan (chip , 1 );
718
- if (ret ) {
719
- of_node_put (chip_np );
719
+ if (ret )
720
720
return dev_err_probe (dev , ret , "failed to scan NAND chip\n" );
721
- }
722
721
723
722
ret = mtd_device_register (mtd , NULL , 0 );
724
723
if (ret ) {
725
724
nand_cleanup (chip );
726
- of_node_put (chip_np );
727
725
return dev_err_probe (dev , ret , "failed to register MTD device\n" );
728
726
}
729
727
You can’t perform that action at this time.
0 commit comments