Commit 89391382 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman

mei: bus: complete variable rename of type struct mei_cl_device

In the
commit 5c079ae11921 ("mei: bus: fix drivers and devices names confusion")
we set the variables of type struct mei_cl_device to 'cldev'
but few places were left out, namely mei_cl_bus.h header
and the mei nfc drivers.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 01a14ede
...@@ -118,7 +118,7 @@ static int mei_nfc_if_version(struct nfc_mei_phy *phy) ...@@ -118,7 +118,7 @@ static int mei_nfc_if_version(struct nfc_mei_phy *phy)
cmd.sub_command = MEI_NFC_SUBCMD_IF_VERSION; cmd.sub_command = MEI_NFC_SUBCMD_IF_VERSION;
MEI_DUMP_NFC_HDR("version", &cmd.hdr); MEI_DUMP_NFC_HDR("version", &cmd.hdr);
r = mei_cl_send(phy->device, (u8 *)&cmd, sizeof(struct mei_nfc_cmd)); r = mei_cl_send(phy->cldev, (u8 *)&cmd, sizeof(struct mei_nfc_cmd));
if (r < 0) { if (r < 0) {
pr_err("Could not send IF version cmd\n"); pr_err("Could not send IF version cmd\n");
return r; return r;
...@@ -132,7 +132,7 @@ static int mei_nfc_if_version(struct nfc_mei_phy *phy) ...@@ -132,7 +132,7 @@ static int mei_nfc_if_version(struct nfc_mei_phy *phy)
if (!reply) if (!reply)
return -ENOMEM; return -ENOMEM;
bytes_recv = mei_cl_recv(phy->device, (u8 *)reply, if_version_length); bytes_recv = mei_cl_recv(phy->cldev, (u8 *)reply, if_version_length);
if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) { if (bytes_recv < 0 || bytes_recv < sizeof(struct mei_nfc_reply)) {
pr_err("Could not read IF version\n"); pr_err("Could not read IF version\n");
r = -EIO; r = -EIO;
...@@ -186,13 +186,13 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy) ...@@ -186,13 +186,13 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy)
connect->vendor_id = phy->vendor_id; connect->vendor_id = phy->vendor_id;
MEI_DUMP_NFC_HDR("connect request", &cmd->hdr); MEI_DUMP_NFC_HDR("connect request", &cmd->hdr);
r = mei_cl_send(phy->device, (u8 *)cmd, connect_length); r = mei_cl_send(phy->cldev, (u8 *)cmd, connect_length);
if (r < 0) { if (r < 0) {
pr_err("Could not send connect cmd %d\n", r); pr_err("Could not send connect cmd %d\n", r);
goto err; goto err;
} }
bytes_recv = mei_cl_recv(phy->device, (u8 *)reply, connect_resp_length); bytes_recv = mei_cl_recv(phy->cldev, (u8 *)reply, connect_resp_length);
if (bytes_recv < 0) { if (bytes_recv < 0) {
r = bytes_recv; r = bytes_recv;
pr_err("Could not read connect response %d\n", r); pr_err("Could not read connect response %d\n", r);
...@@ -238,7 +238,7 @@ static int mei_nfc_send(struct nfc_mei_phy *phy, u8 *buf, size_t length) ...@@ -238,7 +238,7 @@ static int mei_nfc_send(struct nfc_mei_phy *phy, u8 *buf, size_t length)
MEI_DUMP_NFC_HDR("send", hdr); MEI_DUMP_NFC_HDR("send", hdr);
memcpy(mei_buf + MEI_NFC_HEADER_SIZE, buf, length); memcpy(mei_buf + MEI_NFC_HEADER_SIZE, buf, length);
err = mei_cl_send(phy->device, mei_buf, length + MEI_NFC_HEADER_SIZE); err = mei_cl_send(phy->cldev, mei_buf, length + MEI_NFC_HEADER_SIZE);
if (err < 0) if (err < 0)
goto out; goto out;
...@@ -278,7 +278,7 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length) ...@@ -278,7 +278,7 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length)
struct mei_nfc_hdr *hdr; struct mei_nfc_hdr *hdr;
int received_length; int received_length;
received_length = mei_cl_recv(phy->device, buf, length); received_length = mei_cl_recv(phy->cldev, buf, length);
if (received_length < 0) if (received_length < 0)
return received_length; return received_length;
...@@ -296,7 +296,7 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length) ...@@ -296,7 +296,7 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length)
} }
static void nfc_mei_event_cb(struct mei_cl_device *device, u32 events, static void nfc_mei_event_cb(struct mei_cl_device *cldev, u32 events,
void *context) void *context)
{ {
struct nfc_mei_phy *phy = context; struct nfc_mei_phy *phy = context;
...@@ -337,7 +337,7 @@ static int nfc_mei_phy_enable(void *phy_id) ...@@ -337,7 +337,7 @@ static int nfc_mei_phy_enable(void *phy_id)
if (phy->powered == 1) if (phy->powered == 1)
return 0; return 0;
r = mei_cl_enable_device(phy->device); r = mei_cl_enable_device(phy->cldev);
if (r < 0) { if (r < 0) {
pr_err("Could not enable device %d\n", r); pr_err("Could not enable device %d\n", r);
return r; return r;
...@@ -355,7 +355,7 @@ static int nfc_mei_phy_enable(void *phy_id) ...@@ -355,7 +355,7 @@ static int nfc_mei_phy_enable(void *phy_id)
goto err; goto err;
} }
r = mei_cl_register_event_cb(phy->device, BIT(MEI_CL_EVENT_RX), r = mei_cl_register_event_cb(phy->cldev, BIT(MEI_CL_EVENT_RX),
nfc_mei_event_cb, phy); nfc_mei_event_cb, phy);
if (r) { if (r) {
pr_err("Event cb registration failed %d\n", r); pr_err("Event cb registration failed %d\n", r);
...@@ -368,7 +368,7 @@ static int nfc_mei_phy_enable(void *phy_id) ...@@ -368,7 +368,7 @@ static int nfc_mei_phy_enable(void *phy_id)
err: err:
phy->powered = 0; phy->powered = 0;
mei_cl_disable_device(phy->device); mei_cl_disable_device(phy->cldev);
return r; return r;
} }
...@@ -378,7 +378,7 @@ static void nfc_mei_phy_disable(void *phy_id) ...@@ -378,7 +378,7 @@ static void nfc_mei_phy_disable(void *phy_id)
pr_info("%s\n", __func__); pr_info("%s\n", __func__);
mei_cl_disable_device(phy->device); mei_cl_disable_device(phy->cldev);
phy->powered = 0; phy->powered = 0;
} }
...@@ -390,7 +390,7 @@ struct nfc_phy_ops mei_phy_ops = { ...@@ -390,7 +390,7 @@ struct nfc_phy_ops mei_phy_ops = {
}; };
EXPORT_SYMBOL_GPL(mei_phy_ops); EXPORT_SYMBOL_GPL(mei_phy_ops);
struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *device) struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *cldev)
{ {
struct nfc_mei_phy *phy; struct nfc_mei_phy *phy;
...@@ -398,9 +398,9 @@ struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *device) ...@@ -398,9 +398,9 @@ struct nfc_mei_phy *nfc_mei_phy_alloc(struct mei_cl_device *device)
if (!phy) if (!phy)
return NULL; return NULL;
phy->device = device; phy->cldev = cldev;
init_waitqueue_head(&phy->send_wq); init_waitqueue_head(&phy->send_wq);
mei_cl_set_drvdata(device, phy); mei_cl_set_drvdata(cldev, phy);
return phy; return phy;
} }
...@@ -408,7 +408,7 @@ EXPORT_SYMBOL_GPL(nfc_mei_phy_alloc); ...@@ -408,7 +408,7 @@ EXPORT_SYMBOL_GPL(nfc_mei_phy_alloc);
void nfc_mei_phy_free(struct nfc_mei_phy *phy) void nfc_mei_phy_free(struct nfc_mei_phy *phy)
{ {
mei_cl_disable_device(phy->device); mei_cl_disable_device(phy->cldev);
kfree(phy); kfree(phy);
} }
EXPORT_SYMBOL_GPL(nfc_mei_phy_free); EXPORT_SYMBOL_GPL(nfc_mei_phy_free);
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
/** /**
* struct nfc_mei_phy * struct nfc_mei_phy
* *
* @device: mei device * @cldev: mei client device
* @hdev: nfc hci device * @hdev: nfc hci device
* @send_wq: send completion wait queue * @send_wq: send completion wait queue
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
* and prevents normal operation. * and prevents normal operation.
*/ */
struct nfc_mei_phy { struct nfc_mei_phy {
struct mei_cl_device *device; struct mei_cl_device *cldev;
struct nfc_hci_dev *hdev; struct nfc_hci_dev *hdev;
wait_queue_head_t send_wq; wait_queue_head_t send_wq;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#define MICROREAD_DRIVER_NAME "microread" #define MICROREAD_DRIVER_NAME "microread"
static int microread_mei_probe(struct mei_cl_device *device, static int microread_mei_probe(struct mei_cl_device *cldev,
const struct mei_cl_device_id *id) const struct mei_cl_device_id *id)
{ {
struct nfc_mei_phy *phy; struct nfc_mei_phy *phy;
...@@ -37,7 +37,7 @@ static int microread_mei_probe(struct mei_cl_device *device, ...@@ -37,7 +37,7 @@ static int microread_mei_probe(struct mei_cl_device *device,
pr_info("Probing NFC microread\n"); pr_info("Probing NFC microread\n");
phy = nfc_mei_phy_alloc(device); phy = nfc_mei_phy_alloc(cldev);
if (!phy) { if (!phy) {
pr_err("Cannot allocate memory for microread mei phy.\n"); pr_err("Cannot allocate memory for microread mei phy.\n");
return -ENOMEM; return -ENOMEM;
...@@ -55,9 +55,9 @@ static int microread_mei_probe(struct mei_cl_device *device, ...@@ -55,9 +55,9 @@ static int microread_mei_probe(struct mei_cl_device *device,
return 0; return 0;
} }
static int microread_mei_remove(struct mei_cl_device *device) static int microread_mei_remove(struct mei_cl_device *cldev)
{ {
struct nfc_mei_phy *phy = mei_cl_get_drvdata(device); struct nfc_mei_phy *phy = mei_cl_get_drvdata(cldev);
microread_remove(phy->hdev); microread_remove(phy->hdev);
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define PN544_DRIVER_NAME "pn544" #define PN544_DRIVER_NAME "pn544"
static int pn544_mei_probe(struct mei_cl_device *device, static int pn544_mei_probe(struct mei_cl_device *cldev,
const struct mei_cl_device_id *id) const struct mei_cl_device_id *id)
{ {
struct nfc_mei_phy *phy; struct nfc_mei_phy *phy;
...@@ -35,7 +35,7 @@ static int pn544_mei_probe(struct mei_cl_device *device, ...@@ -35,7 +35,7 @@ static int pn544_mei_probe(struct mei_cl_device *device,
pr_info("Probing NFC pn544\n"); pr_info("Probing NFC pn544\n");
phy = nfc_mei_phy_alloc(device); phy = nfc_mei_phy_alloc(cldev);
if (!phy) { if (!phy) {
pr_err("Cannot allocate memory for pn544 mei phy.\n"); pr_err("Cannot allocate memory for pn544 mei phy.\n");
return -ENOMEM; return -ENOMEM;
...@@ -53,9 +53,9 @@ static int pn544_mei_probe(struct mei_cl_device *device, ...@@ -53,9 +53,9 @@ static int pn544_mei_probe(struct mei_cl_device *device,
return 0; return 0;
} }
static int pn544_mei_remove(struct mei_cl_device *device) static int pn544_mei_remove(struct mei_cl_device *cldev)
{ {
struct nfc_mei_phy *phy = mei_cl_get_drvdata(device); struct nfc_mei_phy *phy = mei_cl_get_drvdata(cldev);
pr_info("Removing pn544\n"); pr_info("Removing pn544\n");
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
struct mei_cl_device; struct mei_cl_device;
struct mei_device; struct mei_device;
typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *device, typedef void (*mei_cl_event_cb_t)(struct mei_cl_device *cldev,
u32 events, void *context); u32 events, void *context);
/** /**
...@@ -62,22 +62,21 @@ struct mei_cl_driver { ...@@ -62,22 +62,21 @@ struct mei_cl_driver {
const struct mei_cl_device_id *id_table; const struct mei_cl_device_id *id_table;
int (*probe)(struct mei_cl_device *dev, int (*probe)(struct mei_cl_device *cldev,
const struct mei_cl_device_id *id); const struct mei_cl_device_id *id);
int (*remove)(struct mei_cl_device *dev); int (*remove)(struct mei_cl_device *cldev);
}; };
int __mei_cl_driver_register(struct mei_cl_driver *driver, int __mei_cl_driver_register(struct mei_cl_driver *cldrv, struct module *owner);
struct module *owner); #define mei_cl_driver_register(cldrv) \
#define mei_cl_driver_register(driver) \ __mei_cl_driver_register(cldrv, THIS_MODULE)
__mei_cl_driver_register(driver, THIS_MODULE)
void mei_cl_driver_unregister(struct mei_cl_driver *driver); void mei_cl_driver_unregister(struct mei_cl_driver *cldrv);
ssize_t mei_cl_send(struct mei_cl_device *device, u8 *buf, size_t length); ssize_t mei_cl_send(struct mei_cl_device *cldev, u8 *buf, size_t length);
ssize_t mei_cl_recv(struct mei_cl_device *device, u8 *buf, size_t length); ssize_t mei_cl_recv(struct mei_cl_device *cldev, u8 *buf, size_t length);
int mei_cl_register_event_cb(struct mei_cl_device *device, int mei_cl_register_event_cb(struct mei_cl_device *cldev,
unsigned long event_mask, unsigned long event_mask,
mei_cl_event_cb_t read_cb, void *context); mei_cl_event_cb_t read_cb, void *context);
...@@ -88,11 +87,11 @@ int mei_cl_register_event_cb(struct mei_cl_device *device, ...@@ -88,11 +87,11 @@ int mei_cl_register_event_cb(struct mei_cl_device *device,
const uuid_le *mei_cldev_uuid(const struct mei_cl_device *cldev); const uuid_le *mei_cldev_uuid(const struct mei_cl_device *cldev);
u8 mei_cldev_ver(const struct mei_cl_device *cldev); u8 mei_cldev_ver(const struct mei_cl_device *cldev);
void *mei_cl_get_drvdata(const struct mei_cl_device *device); void *mei_cl_get_drvdata(const struct mei_cl_device *cldev);
void mei_cl_set_drvdata(struct mei_cl_device *device, void *data); void mei_cl_set_drvdata(struct mei_cl_device *cldev, void *data);
int mei_cl_enable_device(struct mei_cl_device *device); int mei_cl_enable_device(struct mei_cl_device *cldev);
int mei_cl_disable_device(struct mei_cl_device *device); int mei_cl_disable_device(struct mei_cl_device *cldev);
bool mei_cldev_enabled(struct mei_cl_device *cldev); bool mei_cldev_enabled(struct mei_cl_device *cldev);
#endif /* _LINUX_MEI_CL_BUS_H */ #endif /* _LINUX_MEI_CL_BUS_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment