summaryrefslogtreecommitdiff
path: root/drivers/platform/surface
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/surface')
-rw-r--r--drivers/platform/surface/aggregator/bus.c2
-rw-r--r--drivers/platform/surface/aggregator/controller.c4
-rw-r--r--drivers/platform/surface/aggregator/core.c2
-rw-r--r--drivers/platform/surface/surface3_power.c3
-rw-r--r--drivers/platform/surface/surface_aggregator_cdev.c4
-rw-r--r--drivers/platform/surface/surface_dtx.c4
-rw-r--r--drivers/platform/surface/surfacepro3_button.c2
7 files changed, 10 insertions, 11 deletions
diff --git a/drivers/platform/surface/aggregator/bus.c b/drivers/platform/surface/aggregator/bus.c
index d68d231e716e..4395331be659 100644
--- a/drivers/platform/surface/aggregator/bus.c
+++ b/drivers/platform/surface/aggregator/bus.c
@@ -83,7 +83,7 @@ struct ssam_device *ssam_device_alloc(struct ssam_controller *ctrl,
{
struct ssam_device *sdev;
- sdev = kzalloc(sizeof(*sdev), GFP_KERNEL);
+ sdev = kzalloc_obj(*sdev);
if (!sdev)
return NULL;
diff --git a/drivers/platform/surface/aggregator/controller.c b/drivers/platform/surface/aggregator/controller.c
index a265e667538c..6a8430cb9cbf 100644
--- a/drivers/platform/surface/aggregator/controller.c
+++ b/drivers/platform/surface/aggregator/controller.c
@@ -344,7 +344,7 @@ ssam_nf_refcount_inc(struct ssam_nf *nf, struct ssam_event_registry reg,
}
}
- entry = kzalloc(sizeof(*entry), GFP_KERNEL);
+ entry = kzalloc_obj(*entry);
if (!entry)
return ERR_PTR(-ENOMEM);
@@ -623,7 +623,7 @@ static struct ssam_event_item *ssam_event_item_alloc(size_t len, gfp_t flags)
item->ops.free = __ssam_event_item_free_cached;
} else {
- item = kzalloc(struct_size(item, event.data, len), flags);
+ item = kzalloc_flex(*item, event.data, len, flags);
if (!item)
return NULL;
diff --git a/drivers/platform/surface/aggregator/core.c b/drivers/platform/surface/aggregator/core.c
index 82e531023911..43d5988fb964 100644
--- a/drivers/platform/surface/aggregator/core.c
+++ b/drivers/platform/surface/aggregator/core.c
@@ -652,7 +652,7 @@ static int ssam_serial_hub_probe(struct serdev_device *serdev)
}
/* Allocate controller. */
- ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
+ ctrl = kzalloc_obj(*ctrl);
if (!ctrl)
return -ENOMEM;
diff --git a/drivers/platform/surface/surface3_power.c b/drivers/platform/surface/surface3_power.c
index 1ee5239269ae..94fdddc7f207 100644
--- a/drivers/platform/surface/surface3_power.c
+++ b/drivers/platform/surface/surface3_power.c
@@ -454,8 +454,7 @@ static int mshw0011_install_space_handler(struct i2c_client *client)
if (!adev)
return -ENODEV;
- data = kzalloc(sizeof(struct mshw0011_handler_data),
- GFP_KERNEL);
+ data = kzalloc_obj(struct mshw0011_handler_data);
if (!data)
return -ENOMEM;
diff --git a/drivers/platform/surface/surface_aggregator_cdev.c b/drivers/platform/surface/surface_aggregator_cdev.c
index bfaa09d1648b..8929937ba9dc 100644
--- a/drivers/platform/surface/surface_aggregator_cdev.c
+++ b/drivers/platform/surface/surface_aggregator_cdev.c
@@ -154,7 +154,7 @@ static int ssam_cdev_notifier_register(struct ssam_cdev_client *client, u8 tc, i
}
/* Allocate new notifier. */
- nf = kzalloc(sizeof(*nf), GFP_KERNEL);
+ nf = kzalloc_obj(*nf);
if (!nf) {
mutex_unlock(&client->notifier_lock);
return -ENOMEM;
@@ -685,7 +685,7 @@ static int ssam_dbg_device_probe(struct platform_device *pdev)
if (IS_ERR(ctrl))
return PTR_ERR(ctrl) == -ENODEV ? -EPROBE_DEFER : PTR_ERR(ctrl);
- cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
+ cdev = kzalloc_obj(*cdev);
if (!cdev)
return -ENOMEM;
diff --git a/drivers/platform/surface/surface_dtx.c b/drivers/platform/surface/surface_dtx.c
index 97ae010069e4..d6cd56970479 100644
--- a/drivers/platform/surface/surface_dtx.c
+++ b/drivers/platform/surface/surface_dtx.c
@@ -403,7 +403,7 @@ static int surface_dtx_open(struct inode *inode, struct file *file)
struct sdtx_client *client;
/* Initialize client. */
- client = kzalloc(sizeof(*client), GFP_KERNEL);
+ client = kzalloc_obj(*client);
if (!client)
return -ENOMEM;
@@ -1044,7 +1044,7 @@ static struct sdtx_device *sdtx_device_create(struct device *dev, struct ssam_co
struct sdtx_device *ddev;
int status;
- ddev = kzalloc(sizeof(*ddev), GFP_KERNEL);
+ ddev = kzalloc_obj(*ddev);
if (!ddev)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/platform/surface/surfacepro3_button.c b/drivers/platform/surface/surfacepro3_button.c
index e652c85c9161..9bd39f09c7db 100644
--- a/drivers/platform/surface/surfacepro3_button.c
+++ b/drivers/platform/surface/surfacepro3_button.c
@@ -199,7 +199,7 @@ static int surface_button_add(struct acpi_device *device)
if (!surface_button_check_MSHW0040(device))
return -ENODEV;
- button = kzalloc(sizeof(struct surface_button), GFP_KERNEL);
+ button = kzalloc_obj(struct surface_button);
if (!button)
return -ENOMEM;