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

mei: bus: remove rx callback context

The callback context is redunant as all the information can be
retrived from the device struture of its private data.
Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 972cedf6
...@@ -228,7 +228,7 @@ static void mei_cl_bus_event_work(struct work_struct *work) ...@@ -228,7 +228,7 @@ static void mei_cl_bus_event_work(struct work_struct *work)
bus = cldev->bus; bus = cldev->bus;
if (cldev->event_cb) if (cldev->event_cb)
cldev->event_cb(cldev, cldev->events, cldev->event_context); cldev->event_cb(cldev, cldev->events);
cldev->events = 0; cldev->events = 0;
...@@ -301,7 +301,6 @@ bool mei_cl_bus_rx_event(struct mei_cl *cl) ...@@ -301,7 +301,6 @@ bool mei_cl_bus_rx_event(struct mei_cl *cl)
* @cldev: me client devices * @cldev: me client devices
* @event_cb: callback function * @event_cb: callback function
* @events_mask: requested events bitmask * @events_mask: requested events bitmask
* @context: driver context data
* *
* Return: 0 on success * Return: 0 on success
* -EALREADY if an callback is already registered * -EALREADY if an callback is already registered
...@@ -309,7 +308,7 @@ bool mei_cl_bus_rx_event(struct mei_cl *cl) ...@@ -309,7 +308,7 @@ bool mei_cl_bus_rx_event(struct mei_cl *cl)
*/ */
int mei_cldev_register_event_cb(struct mei_cl_device *cldev, int mei_cldev_register_event_cb(struct mei_cl_device *cldev,
unsigned long events_mask, unsigned long events_mask,
mei_cldev_event_cb_t event_cb, void *context) mei_cldev_event_cb_t event_cb)
{ {
struct mei_device *bus = cldev->bus; struct mei_device *bus = cldev->bus;
int ret; int ret;
...@@ -320,7 +319,6 @@ int mei_cldev_register_event_cb(struct mei_cl_device *cldev, ...@@ -320,7 +319,6 @@ int mei_cldev_register_event_cb(struct mei_cl_device *cldev,
cldev->events = 0; cldev->events = 0;
cldev->events_mask = events_mask; cldev->events_mask = events_mask;
cldev->event_cb = event_cb; cldev->event_cb = event_cb;
cldev->event_context = context;
INIT_WORK(&cldev->event_work, mei_cl_bus_event_work); INIT_WORK(&cldev->event_work, mei_cl_bus_event_work);
if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) { if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) {
......
...@@ -297,8 +297,7 @@ static int mei_nfc_recv(struct nfc_mei_phy *phy, u8 *buf, size_t length) ...@@ -297,8 +297,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 *cldev, u32 events, static void nfc_mei_event_cb(struct mei_cl_device *cldev, u32 events)
void *context)
{ {
struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev); struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
...@@ -360,7 +359,7 @@ static int nfc_mei_phy_enable(void *phy_id) ...@@ -360,7 +359,7 @@ static int nfc_mei_phy_enable(void *phy_id)
} }
r = mei_cldev_register_event_cb(phy->cldev, BIT(MEI_CL_EVENT_RX), r = mei_cldev_register_event_cb(phy->cldev, BIT(MEI_CL_EVENT_RX),
nfc_mei_event_cb, phy); nfc_mei_event_cb);
if (r) { if (r) {
pr_err("Event cb registration failed %d\n", r); pr_err("Event cb registration failed %d\n", r);
goto err; goto err;
......
...@@ -501,10 +501,8 @@ static void mei_wdt_notify_event(struct mei_cl_device *cldev) ...@@ -501,10 +501,8 @@ static void mei_wdt_notify_event(struct mei_cl_device *cldev)
* *
* @cldev: bus device * @cldev: bus device
* @events: event mask * @events: event mask
* @context: callback context
*/ */
static void mei_wdt_event(struct mei_cl_device *cldev, static void mei_wdt_event(struct mei_cl_device *cldev, u32 events)
u32 events, void *context)
{ {
if (events & BIT(MEI_CL_EVENT_RX)) if (events & BIT(MEI_CL_EVENT_RX))
mei_wdt_event_rx(cldev); mei_wdt_event_rx(cldev);
...@@ -626,7 +624,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev, ...@@ -626,7 +624,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev,
ret = mei_cldev_register_event_cb(wdt->cldev, ret = mei_cldev_register_event_cb(wdt->cldev,
BIT(MEI_CL_EVENT_RX) | BIT(MEI_CL_EVENT_RX) |
BIT(MEI_CL_EVENT_NOTIF), BIT(MEI_CL_EVENT_NOTIF),
mei_wdt_event, NULL); mei_wdt_event);
/* on legacy devices notification is not supported /* on legacy devices notification is not supported
* this doesn't fail the registration for RX event * this doesn't fail the registration for RX event
......
...@@ -9,7 +9,7 @@ struct mei_cl_device; ...@@ -9,7 +9,7 @@ struct mei_cl_device;
struct mei_device; struct mei_device;
typedef void (*mei_cldev_event_cb_t)(struct mei_cl_device *cldev, typedef void (*mei_cldev_event_cb_t)(struct mei_cl_device *cldev,
u32 events, void *context); u32 events);
/** /**
* struct mei_cl_device - MEI device handle * struct mei_cl_device - MEI device handle
...@@ -27,7 +27,6 @@ typedef void (*mei_cldev_event_cb_t)(struct mei_cl_device *cldev, ...@@ -27,7 +27,6 @@ typedef void (*mei_cldev_event_cb_t)(struct mei_cl_device *cldev,
* @event_work: async work to execute event callback * @event_work: async work to execute event callback
* @event_cb: Drivers register this callback to get asynchronous ME * @event_cb: Drivers register this callback to get asynchronous ME
* events (e.g. Rx buffer pending) notifications. * events (e.g. Rx buffer pending) notifications.
* @event_context: event callback run context
* @events_mask: Events bit mask requested by driver. * @events_mask: Events bit mask requested by driver.
* @events: Events bitmask sent to the driver. * @events: Events bitmask sent to the driver.
* *
...@@ -46,7 +45,6 @@ struct mei_cl_device { ...@@ -46,7 +45,6 @@ struct mei_cl_device {
struct work_struct event_work; struct work_struct event_work;
mei_cldev_event_cb_t event_cb; mei_cldev_event_cb_t event_cb;
void *event_context;
unsigned long events_mask; unsigned long events_mask;
unsigned long events; unsigned long events;
...@@ -92,7 +90,7 @@ ssize_t mei_cldev_recv(struct mei_cl_device *cldev, u8 *buf, size_t length); ...@@ -92,7 +90,7 @@ ssize_t mei_cldev_recv(struct mei_cl_device *cldev, u8 *buf, size_t length);
int mei_cldev_register_event_cb(struct mei_cl_device *cldev, int mei_cldev_register_event_cb(struct mei_cl_device *cldev,
unsigned long event_mask, unsigned long event_mask,
mei_cldev_event_cb_t read_cb, void *context); mei_cldev_event_cb_t read_cb);
#define MEI_CL_EVENT_RX 0 #define MEI_CL_EVENT_RX 0
#define MEI_CL_EVENT_TX 1 #define MEI_CL_EVENT_TX 1
......
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