if (IS_ERR(connection))
return PTR_ERR(connection);
- connection->private = gbcodec;
+ gb_connection_set_data(connection, gbcodec);
gbcodec->mgmt_connection = connection;
return 0;
return PTR_ERR(connection);
}
- connection->private = gbcodec;
+ gb_connection_set_data(connection, gbcodec);
atomic_set(&dai->users, 0);
init_waitqueue_head(&dai->wait_queue);
dai->data_cport = connection->intf_cport_id;
static int gb_camera_event_recv(u8 type, struct gb_operation *op)
{
- struct gb_camera *gcam = op->connection->private;
+ struct gb_camera *gcam = gb_connection_get_data(op->connection);
struct gb_camera_metadata_request *payload;
struct gb_message *request;
return -ENOMEM;
gcam->connection = connection;
- connection->private = gcam;
+ gb_connection_set_data(connection, gcam);
/*
* Create the data connection between camera module CDSI0 and APB CDS1.
static void gb_camera_connection_exit(struct gb_connection *connection)
{
- struct gb_camera *gcam = connection->private;
+ struct gb_camera *gcam = gb_connection_get_data(connection);
gb_camera_unregister_intf_ops(gcam);
return NULL;
}
- control->connection->private = control;
+ gb_connection_set_data(control->connection, control);
return control;
}
static int gb_firmware_size_request(struct gb_operation *op)
{
- struct gb_connection *connection = op->connection;
- struct gb_firmware *firmware = connection->private;
+ struct gb_firmware *firmware = gb_connection_get_data(op->connection);
struct gb_firmware_size_request *size_request = op->request->payload;
struct gb_firmware_size_response *size_response;
- struct device *dev = &connection->bundle->dev;
+ struct device *dev = &op->connection->bundle->dev;
int ret;
if (op->request->payload_size != sizeof(*size_request)) {
static int gb_firmware_get_firmware(struct gb_operation *op)
{
- struct gb_connection *connection = op->connection;
- struct gb_firmware *firmware = connection->private;
+ struct gb_firmware *firmware = gb_connection_get_data(op->connection);
const struct firmware *fw = firmware->fw;
struct gb_firmware_get_firmware_request *firmware_request;
struct gb_firmware_get_firmware_response *firmware_response;
- struct device *dev = &connection->bundle->dev;
+ struct device *dev = &op->connection->bundle->dev;
unsigned int offset, size;
if (op->request->payload_size != sizeof(*firmware_request)) {
goto err_free_firmware;
}
- connection->private = firmware;
+ gb_connection_set_data(connection, firmware);
firmware->connection = connection;
{
struct gb_connection *connection = op->connection;
struct device *dev = &connection->bundle->dev;
- struct gb_gpio_controller *ggc = connection->private;
+ struct gb_gpio_controller *ggc = gb_connection_get_data(connection);
struct gb_message *request;
struct gb_gpio_irq_event_request *event;
int irq;
if (!ggc)
return -ENOMEM;
ggc->connection = connection;
- connection->private = ggc;
+ gb_connection_set_data(connection, ggc);
ret = gb_gpio_controller_setup(ggc);
if (ret)
static void gb_gpio_connection_exit(struct gb_connection *connection)
{
- struct gb_gpio_controller *ggc = connection->private;
+ struct gb_gpio_controller *ggc = gb_connection_get_data(connection);
if (!ggc)
return;
static int gb_hid_request_handler(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_hid *ghid = connection->private;
+ struct gb_hid *ghid = gb_connection_get_data(connection);
struct gb_hid_input_report_request *request = op->request->payload;
if (op->type != GB_HID_TYPE_IRQ_EVENT) {
goto err_free_ghid;
}
- connection->private = ghid;
+ gb_connection_set_data(connection, ghid);
ghid->connection = connection;
hid = hid_allocate_device();
return -ENOMEM;
gb_i2c_dev->connection = connection; /* refcount? */
- connection->private = gb_i2c_dev;
+ gb_connection_set_data(connection, gb_i2c_dev);
ret = gb_i2c_device_setup(gb_i2c_dev);
if (ret)
static void gb_i2c_connection_exit(struct gb_connection *connection)
{
- struct gb_i2c_device *gb_i2c_dev = connection->private;
+ struct gb_i2c_device *gb_i2c_dev = gb_connection_get_data(connection);
i2c_del_adapter(&gb_i2c_dev->adapter);
/* kref_put(gb_i2c_dev->connection) */
{
struct gb_connection *connection = op->connection;
struct device *dev = &connection->bundle->dev;
- struct gb_lights *glights = connection->private;
+ struct gb_lights *glights = gb_connection_get_data(connection);
struct gb_light *light;
struct gb_message *request;
struct gb_lights_event_request *payload;
}
glights->connection = connection;
- connection->private = glights;
+ gb_connection_set_data(connection, glights);
mutex_init(&glights->lights_lock);
static int gb_supplies_request_handler(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_power_supplies *supplies = connection->private;
+ struct gb_power_supplies *supplies = gb_connection_get_data(connection);
struct gb_power_supply *gbpsy;
struct gb_message *request;
struct gb_power_supply_event_request *payload;
}
supplies->connection = connection;
- connection->private = supplies;
+ gb_connection_set_data(connection, supplies);
mutex_init(&supplies->supplies_lock);
if (!pwmc)
return -ENOMEM;
pwmc->connection = connection;
- connection->private = pwmc;
+ gb_connection_set_data(connection, pwmc);
/* Query number of pwms present */
ret = gb_pwm_count_operation(pwmc);
static void gb_pwm_connection_exit(struct gb_connection *connection)
{
- struct gb_pwm_chip *pwmc = connection->private;
-
+ struct gb_pwm_chip *pwmc = gb_connection_get_data(connection);
if (!pwmc)
return;
static int gb_sdio_event_recv(u8 type, struct gb_operation *op)
{
- struct gb_connection *connection = op->connection;
- struct gb_sdio_host *host = connection->private;
+ struct gb_sdio_host *host = gb_connection_get_data(op->connection);
struct gb_message *request;
struct gb_sdio_event_request *payload;
int ret = 0;
u8 event;
if (type != GB_SDIO_TYPE_EVENT) {
- dev_err(&connection->bundle->dev,
+ dev_err(mmc_dev(host->mmc),
"unsupported unsolicited event: %u\n", type);
return -EINVAL;
}
host->removed = true;
host->connection = connection;
- connection->private = host;
+ gb_connection_set_data(connection, host);
ret = gb_sdio_get_caps(host);
if (ret < 0)
free_buffer:
kfree(host->xfer_buffer);
free_mmc:
- connection->private = NULL;
+ gb_connection_set_data(connection, NULL);
mmc_free_host(mmc);
return ret;
static void gb_sdio_connection_exit(struct gb_connection *connection)
{
struct mmc_host *mmc;
- struct gb_sdio_host *host = connection->private;
+ struct gb_sdio_host *host = gb_connection_get_data(connection);
if (!host)
return;
mutex_lock(&host->lock);
host->removed = true;
mmc = host->mmc;
- connection->private = NULL;
+ gb_connection_set_data(connection, NULL);
mutex_unlock(&host->lock);
flush_workqueue(host->mrq_workqueue);
static struct spi_master *get_master_from_spi(struct gb_spi *spi)
{
- return spi->connection->private;
+ return gb_connection_get_data(spi->connection);
}
static int tx_header_fit_operation(u32 tx_size, u32 count, size_t data_max)
spi = spi_master_get_devdata(master);
spi->connection = connection;
- connection->private = master;
+ gb_connection_set_data(connection, master);
/* get master configuration */
ret = gb_spi_get_master_config(spi);
static void gb_spi_connection_exit(struct gb_connection *connection)
{
- struct spi_master *master = connection->private;
+ struct spi_master *master = gb_connection_get_data(connection);
spi_unregister_master(master);
}
static int gb_svc_version_request(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_svc *svc = connection->private;
+ struct gb_svc *svc = gb_connection_get_data(connection);
struct gb_protocol_version_request *request;
struct gb_protocol_version_response *response;
static int gb_svc_hello(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_svc *svc = connection->private;
+ struct gb_svc *svc = gb_connection_get_data(connection);
struct gb_svc_hello_request *hello_request;
int ret;
{
struct gb_svc_intf_hotplug_request *request;
struct gb_connection *connection = operation->connection;
- struct gb_svc *svc = connection->private;
+ struct gb_svc *svc = gb_connection_get_data(connection);
struct gb_host_device *hd = connection->hd;
struct gb_interface *intf;
u8 intf_id;
static void gb_svc_process_intf_hot_unplug(struct gb_operation *operation)
{
- struct gb_svc *svc = operation->connection->private;
+ struct gb_svc *svc = gb_connection_get_data(operation->connection);
struct gb_svc_intf_hot_unplug_request *request;
struct gb_host_device *hd = operation->connection->hd;
struct gb_interface *intf;
dr = container_of(work, struct gb_svc_deferred_request, work);
operation = dr->operation;
- svc = operation->connection->private;
+ svc = gb_connection_get_data(operation->connection);
type = operation->request->header->type;
switch (type) {
static int gb_svc_queue_deferred_request(struct gb_operation *operation)
{
- struct gb_svc *svc = operation->connection->private;
+ struct gb_svc *svc = gb_connection_get_data(operation->connection);
struct gb_svc_deferred_request *dr;
dr = kmalloc(sizeof(*dr), GFP_KERNEL);
*/
static int gb_svc_intf_hotplug_recv(struct gb_operation *op)
{
- struct gb_svc *svc = op->connection->private;
+ struct gb_svc *svc = gb_connection_get_data(op->connection);
struct gb_svc_intf_hotplug_request *request;
if (op->request->payload_size < sizeof(*request)) {
static int gb_svc_intf_hot_unplug_recv(struct gb_operation *op)
{
- struct gb_svc *svc = op->connection->private;
+ struct gb_svc *svc = gb_connection_get_data(op->connection);
struct gb_svc_intf_hot_unplug_request *request;
if (op->request->payload_size < sizeof(*request)) {
static int gb_svc_intf_reset_recv(struct gb_operation *op)
{
- struct gb_svc *svc = op->connection->private;
+ struct gb_svc *svc = gb_connection_get_data(op->connection);
struct gb_message *request = op->request;
struct gb_svc_intf_reset_request *reset;
u8 intf_id;
static int gb_svc_key_event_recv(struct gb_operation *op)
{
- struct gb_svc *svc = op->connection->private;
+ struct gb_svc *svc = gb_connection_get_data(op->connection);
struct gb_message *request = op->request;
struct gb_svc_key_event_request *key;
u16 code;
static int gb_svc_request_handler(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_svc *svc = connection->private;
+ struct gb_svc *svc = gb_connection_get_data(connection);
u8 type = op->type;
int ret = 0;
goto err_free_input;
}
- svc->connection->private = svc;
+ gb_connection_set_data(svc->connection, svc);
return svc;
static int gb_uart_receive_data_handler(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_tty *gb_tty = connection->private;
+ struct gb_tty *gb_tty = gb_connection_get_data(connection);
struct tty_port *port = &gb_tty->port;
struct gb_message *request = op->request;
struct gb_uart_recv_data_request *receive_data;
static int gb_uart_serial_state_handler(struct gb_operation *op)
{
struct gb_connection *connection = op->connection;
- struct gb_tty *gb_tty = connection->private;
+ struct gb_tty *gb_tty = gb_connection_get_data(connection);
struct gb_message *request = op->request;
struct gb_uart_serial_state_request *serial_state;
}
gb_tty->connection = connection;
- connection->private = gb_tty;
+ gb_connection_set_data(connection, gb_tty);
minor = alloc_minor(gb_tty);
if (minor < 0) {
tty_port_destroy(&gb_tty->port);
release_minor(gb_tty);
error_minor:
- connection->private = NULL;
+ gb_connection_set_data(connection, NULL);
kfree(gb_tty->buffer);
error_payload:
kfree(gb_tty);
static void gb_uart_connection_exit(struct gb_connection *connection)
{
- struct gb_tty *gb_tty = connection->private;
+ struct gb_tty *gb_tty = gb_connection_get_data(connection);
struct tty_struct *tty;
if (!gb_tty)
gb_tty->disconnected = true;
wake_up_all(&gb_tty->wioctl);
- connection->private = NULL;
+ gb_connection_set_data(connection, NULL);
mutex_unlock(&gb_tty->mutex);
tty = tty_port_tty_get(&gb_tty->port);
gb_usb_dev = to_gb_usb_device(hcd);
gb_usb_dev->connection = connection;
- connection->private = gb_usb_dev;
+ gb_connection_set_data(connection, gb_usb_dev);
hcd->has_tt = 1;
static void gb_usb_connection_exit(struct gb_connection *connection)
{
- struct gb_usb_device *gb_usb_dev = connection->private;
+ struct gb_usb_device *gb_usb_dev = gb_connection_get_data(connection);
struct usb_hcd *hcd = gb_usb_device_to_hcd(gb_usb_dev);
usb_remove_hcd(hcd);
retval = PTR_ERR(connection);
goto err_free_vib;
}
- connection->private = vib;
+ gb_connection_set_data(connection, vib);
vib->connection = connection;