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: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Tomas Winkler 2016-10-19 16:33:31 +03:00 committed by Greg Kroah-Hartman
parent 972cedf6e3
commit 1e4edb3fe9
4 changed files with 8 additions and 15 deletions

View File

@ -228,7 +228,7 @@ static void mei_cl_bus_event_work(struct work_struct *work)
bus = cldev->bus;
if (cldev->event_cb)
cldev->event_cb(cldev, cldev->events, cldev->event_context);
cldev->event_cb(cldev, cldev->events);
cldev->events = 0;
@ -301,7 +301,6 @@ bool mei_cl_bus_rx_event(struct mei_cl *cl)
* @cldev: me client devices
* @event_cb: callback function
* @events_mask: requested events bitmask
* @context: driver context data
*
* Return: 0 on success
* -EALREADY if an callback is already registered
@ -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,
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;
int ret;
@ -320,7 +319,6 @@ int mei_cldev_register_event_cb(struct mei_cl_device *cldev,
cldev->events = 0;
cldev->events_mask = events_mask;
cldev->event_cb = event_cb;
cldev->event_context = context;
INIT_WORK(&cldev->event_work, mei_cl_bus_event_work);
if (cldev->events_mask & BIT(MEI_CL_EVENT_RX)) {

View File

@ -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,
void *context)
static void nfc_mei_event_cb(struct mei_cl_device *cldev, u32 events)
{
struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
@ -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),
nfc_mei_event_cb, phy);
nfc_mei_event_cb);
if (r) {
pr_err("Event cb registration failed %d\n", r);
goto err;

View File

@ -501,10 +501,8 @@ static void mei_wdt_notify_event(struct mei_cl_device *cldev)
*
* @cldev: bus device
* @events: event mask
* @context: callback context
*/
static void mei_wdt_event(struct mei_cl_device *cldev,
u32 events, void *context)
static void mei_wdt_event(struct mei_cl_device *cldev, u32 events)
{
if (events & BIT(MEI_CL_EVENT_RX))
mei_wdt_event_rx(cldev);
@ -626,7 +624,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev,
ret = mei_cldev_register_event_cb(wdt->cldev,
BIT(MEI_CL_EVENT_RX) |
BIT(MEI_CL_EVENT_NOTIF),
mei_wdt_event, NULL);
mei_wdt_event);
/* on legacy devices notification is not supported
* this doesn't fail the registration for RX event

View File

@ -9,7 +9,7 @@ struct mei_cl_device;
struct mei_device;
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
@ -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_cb: Drivers register this callback to get asynchronous ME
* events (e.g. Rx buffer pending) notifications.
* @event_context: event callback run context
* @events_mask: Events bit mask requested by driver.
* @events: Events bitmask sent to the driver.
*
@ -46,7 +45,6 @@ struct mei_cl_device {
struct work_struct event_work;
mei_cldev_event_cb_t event_cb;
void *event_context;
unsigned long events_mask;
unsigned long events;
@ -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,
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_TX 1