@@ -181,15 +181,13 @@ static int sunxi_sid_probe(struct platform_device *pdev)
181
181
else
182
182
econfig .reg_read = sunxi_sid_read ;
183
183
econfig .priv = sid ;
184
- nvmem = nvmem_register ( & econfig );
184
+ nvmem = devm_nvmem_register ( dev , & econfig );
185
185
if (IS_ERR (nvmem ))
186
186
return PTR_ERR (nvmem );
187
187
188
188
randomness = kzalloc (size , GFP_KERNEL );
189
- if (!randomness ) {
190
- ret = - ENOMEM ;
191
- goto err_unreg_nvmem ;
192
- }
189
+ if (!randomness )
190
+ return - ENOMEM ;
193
191
194
192
for (i = 0 ; i < size ; i ++ )
195
193
econfig .reg_read (sid , i , & randomness [i ], 1 );
@@ -200,17 +198,6 @@ static int sunxi_sid_probe(struct platform_device *pdev)
200
198
platform_set_drvdata (pdev , nvmem );
201
199
202
200
return 0 ;
203
-
204
- err_unreg_nvmem :
205
- nvmem_unregister (nvmem );
206
- return ret ;
207
- }
208
-
209
- static int sunxi_sid_remove (struct platform_device * pdev )
210
- {
211
- struct nvmem_device * nvmem = platform_get_drvdata (pdev );
212
-
213
- return nvmem_unregister (nvmem );
214
201
}
215
202
216
203
static const struct sunxi_sid_cfg sun4i_a10_cfg = {
@@ -243,7 +230,6 @@ MODULE_DEVICE_TABLE(of, sunxi_sid_of_match);
243
230
244
231
static struct platform_driver sunxi_sid_driver = {
245
232
.probe = sunxi_sid_probe ,
246
- .remove = sunxi_sid_remove ,
247
233
.driver = {
248
234
.name = "eeprom-sunxi-sid" ,
249
235
.of_match_table = sunxi_sid_of_match ,
0 commit comments