{
struct device_node *np = client->dev.of_node;
struct ubnt_ledbar *ledbar;
+ int err;
ledbar = devm_kzalloc(&client->dev, sizeof(*ledbar), GFP_KERNEL);
if (!ledbar)
ledbar->client = client;
- mutex_init(&ledbar->lock);
+ err = devm_mutex_init(&ofdev->dev, &ledbar->lock);
+ if (err)
+ return err;
i2c_set_clientdata(client, ledbar);
return ubnt_ledbar_apply_state(ledbar);
}
-static void ubnt_ledbar_remove(struct i2c_client *client)
-{
- struct ubnt_ledbar *ledbar = i2c_get_clientdata(client);
-
- mutex_destroy(&ledbar->lock);
-}
-
static const struct i2c_device_id ubnt_ledbar_id[] = {
{ "ubnt-ledbar", 0 },
{ }
.of_match_table = of_ubnt_ledbar_match,
},
.probe = ubnt_ledbar_probe,
- .remove = ubnt_ledbar_remove,
.id_table = ubnt_ledbar_id,
};
module_i2c_driver(ubnt_ledbar_driver);