@ -171,8 +171,7 @@ static int gpio_dwapb_bind(struct udevice *dev)
if ( ! fdtdec_get_bool ( blob , node , " gpio-controller " ) )
if ( ! fdtdec_get_bool ( blob , node , " gpio-controller " ) )
continue ;
continue ;
plat = NULL ;
plat = devm_kcalloc ( dev , 1 , sizeof ( * plat ) , GFP_KERNEL ) ;
plat = calloc ( 1 , sizeof ( * plat ) ) ;
if ( ! plat )
if ( ! plat )
return - ENOMEM ;
return - ENOMEM ;
@ -181,23 +180,17 @@ static int gpio_dwapb_bind(struct udevice *dev)
plat - > pins = fdtdec_get_int ( blob , node , " snps,nr-gpios " , 0 ) ;
plat - > pins = fdtdec_get_int ( blob , node , " snps,nr-gpios " , 0 ) ;
plat - > name = fdt_stringlist_get ( blob , node , " bank-name " , 0 ,
plat - > name = fdt_stringlist_get ( blob , node , " bank-name " , 0 ,
NULL ) ;
NULL ) ;
if ( ret )
goto err ;
ret = device_bind ( dev , dev - > driver , plat - > name ,
ret = device_bind ( dev , dev - > driver , plat - > name ,
plat , - 1 , & subdev ) ;
plat , - 1 , & subdev ) ;
if ( ret )
if ( ret )
goto err ;
return ret ;
dev_set_of_offset ( subdev , node ) ;
dev_set_of_offset ( subdev , node ) ;
bank + + ;
bank + + ;
}
}
return 0 ;
return 0 ;
err :
free ( plat ) ;
return ret ;
}
}
static int gpio_dwapb_remove ( struct udevice * dev )
static int gpio_dwapb_remove ( struct udevice * dev )