Usage of counter_register() yields issues in device lifetime tracking. All drivers were converted to the new API, so the old one can go away.
Showing the changes to include (1 of 2 files). Show all
Unified · Split
| @@ -314,8 +314,6 @@ struct counter_device { · 313 unmodified lines | |||
| 314 | struct counter_comp *ext; | 314 | struct counter_comp *ext; |
| 315 | size_t num_ext; | 315 | size_t num_ext; |
| 316 | 316 | ||
| 317 | void *priv; | ||
| 318 | |||
| 319 | struct device dev; | 317 | struct device dev; |
| 320 | struct cdev chrdev; | 318 | struct cdev chrdev; |
| 321 | struct list_head events_list; | 319 | struct list_head events_list; |
| @@ -327,25 +325,15 @@ struct counter_device { · 5 unmodified lines | |||
| 327 | spinlock_t events_in_lock; | 325 | spinlock_t events_in_lock; |
| 328 | struct mutex events_out_lock; | 326 | struct mutex events_out_lock; |
| 329 | struct mutex ops_exist_lock; | 327 | struct mutex ops_exist_lock; |
| 330 | |||
| 331 | /* | ||
| 332 | * This can go away once all drivers are converted to | ||
| 333 | * counter_alloc()/counter_add(). | ||
| 334 | */ | ||
| 335 | bool legacy_device; | ||
| 336 | }; | 328 | }; |
| 337 | 329 | ||
| 338 | void *counter_priv(const struct counter_device *const counter); | 330 | void *counter_priv(const struct counter_device *const counter); |
| 339 | 331 | ||
| 340 | int counter_register(struct counter_device *const counter); | ||
| 341 | |||
| 342 | struct counter_device *counter_alloc(size_t sizeof_priv); | 332 | struct counter_device *counter_alloc(size_t sizeof_priv); |
| 343 | void counter_put(struct counter_device *const counter); | 333 | void counter_put(struct counter_device *const counter); |
| 344 | int counter_add(struct counter_device *const counter); | 334 | int counter_add(struct counter_device *const counter); |
| 345 | 335 | ||
| 346 | void counter_unregister(struct counter_device *const counter); | 336 | void counter_unregister(struct counter_device *const counter); |
| 347 | int devm_counter_register(struct device *dev, | ||
| 348 | struct counter_device *const counter); | ||
| 349 | struct counter_device *devm_counter_alloc(struct device *dev, | 337 | struct counter_device *devm_counter_alloc(struct device *dev, |
| 350 | size_t sizeof_priv); | 338 | size_t sizeof_priv); |
| 351 | int devm_counter_add(struct device *dev, | 339 | int devm_counter_add(struct device *dev, |