diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:35:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 17:39:31 +0000 |
commit | 85c675d0d09a45a135bddd15d7b385f8758c32fb (patch) | |
tree | 76267dbc9b9a130337be3640948fe397b04ac629 /drivers/staging/greybus | |
parent | Adding upstream version 6.6.15. (diff) | |
download | linux-85c675d0d09a45a135bddd15d7b385f8758c32fb.tar.xz linux-85c675d0d09a45a135bddd15d7b385f8758c32fb.zip |
Adding upstream version 6.7.7.upstream/6.7.7
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/staging/greybus')
-rw-r--r-- | drivers/staging/greybus/audio_manager_private.h | 7 | ||||
-rw-r--r-- | drivers/staging/greybus/authentication.c | 19 | ||||
-rw-r--r-- | drivers/staging/greybus/bootrom.c | 2 | ||||
-rw-r--r-- | drivers/staging/greybus/camera.c | 13 | ||||
-rw-r--r-- | drivers/staging/greybus/fw-management.c | 19 | ||||
-rw-r--r-- | drivers/staging/greybus/pwm.c | 1 | ||||
-rw-r--r-- | drivers/staging/greybus/raw.c | 23 |
7 files changed, 43 insertions, 41 deletions
diff --git a/drivers/staging/greybus/audio_manager_private.h b/drivers/staging/greybus/audio_manager_private.h index 2b3a766c7d..daca5b48b9 100644 --- a/drivers/staging/greybus/audio_manager_private.h +++ b/drivers/staging/greybus/audio_manager_private.h @@ -12,10 +12,9 @@ #include "audio_manager.h" -int gb_audio_manager_module_create( - struct gb_audio_manager_module **module, - struct kset *manager_kset, - int id, struct gb_audio_manager_module_descriptor *desc); +int gb_audio_manager_module_create(struct gb_audio_manager_module **module, + struct kset *manager_kset, int id, + struct gb_audio_manager_module_descriptor *desc); /* module destroyed via kobject_put */ diff --git a/drivers/staging/greybus/authentication.c b/drivers/staging/greybus/authentication.c index 7e01790a46..b67315641d 100644 --- a/drivers/staging/greybus/authentication.c +++ b/drivers/staging/greybus/authentication.c @@ -36,7 +36,10 @@ struct gb_cap { dev_t dev_num; }; -static struct class *cap_class; +static const struct class cap_class = { + .name = "gb_authenticate", +}; + static dev_t cap_dev_num; static DEFINE_IDA(cap_minors_map); static LIST_HEAD(cap_list); @@ -336,7 +339,7 @@ int gb_cap_connection_init(struct gb_connection *connection) goto err_remove_ida; /* Add a soft link to the previously added char-dev within the bundle */ - cap->class_device = device_create(cap_class, cap->parent, cap->dev_num, + cap->class_device = device_create(&cap_class, cap->parent, cap->dev_num, NULL, "gb-authenticate-%d", minor); if (IS_ERR(cap->class_device)) { ret = PTR_ERR(cap->class_device); @@ -370,7 +373,7 @@ void gb_cap_connection_exit(struct gb_connection *connection) cap = gb_connection_get_data(connection); - device_destroy(cap_class, cap->dev_num); + device_destroy(&cap_class, cap->dev_num); cdev_del(&cap->cdev); ida_simple_remove(&cap_minors_map, MINOR(cap->dev_num)); @@ -402,9 +405,9 @@ int cap_init(void) { int ret; - cap_class = class_create("gb_authenticate"); - if (IS_ERR(cap_class)) - return PTR_ERR(cap_class); + ret = class_register(&cap_class); + if (ret) + return ret; ret = alloc_chrdev_region(&cap_dev_num, 0, NUM_MINORS, "gb_authenticate"); @@ -414,13 +417,13 @@ int cap_init(void) return 0; err_remove_class: - class_destroy(cap_class); + class_unregister(&cap_class); return ret; } void cap_exit(void) { unregister_chrdev_region(cap_dev_num, NUM_MINORS); - class_destroy(cap_class); + class_unregister(&cap_class); ida_destroy(&cap_minors_map); } diff --git a/drivers/staging/greybus/bootrom.c b/drivers/staging/greybus/bootrom.c index a8efb86de1..79581457c4 100644 --- a/drivers/staging/greybus/bootrom.c +++ b/drivers/staging/greybus/bootrom.c @@ -491,8 +491,6 @@ static void gb_bootrom_disconnect(struct gb_bundle *bundle) { struct gb_bootrom *bootrom = greybus_get_drvdata(bundle); - dev_dbg(&bundle->dev, "%s\n", __func__); - gb_connection_disable(bootrom->connection); /* Disable timeouts */ diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index cdbb42cd41..a8173aa3a9 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -220,7 +220,7 @@ static int gb_camera_operation_sync_flags(struct gb_connection *connection, } static int gb_camera_get_max_pkt_size(struct gb_camera *gcam, - struct gb_camera_configure_streams_response *resp) + struct gb_camera_configure_streams_response *resp) { unsigned int max_pkt_size = 0; unsigned int i; @@ -267,8 +267,7 @@ static int gb_camera_get_max_pkt_size(struct gb_camera *gcam, * Validate the stream configuration response verifying padding is correctly * set and the returned number of streams is supported */ -static const int gb_camera_configure_streams_validate_response( - struct gb_camera *gcam, +static const int gb_camera_configure_streams_validate_response(struct gb_camera *gcam, struct gb_camera_configure_streams_response *resp, unsigned int nstreams) { @@ -378,8 +377,8 @@ struct ap_csi_config_request { #define GB_CAMERA_CSI_CLK_FREQ_MARGIN 150000000U static int gb_camera_setup_data_connection(struct gb_camera *gcam, - struct gb_camera_configure_streams_response *resp, - struct gb_camera_csi_params *csi_params) + struct gb_camera_configure_streams_response *resp, + struct gb_camera_csi_params *csi_params) { struct ap_csi_config_request csi_cfg; struct gb_connection *conn; @@ -783,8 +782,8 @@ static ssize_t gb_camera_op_capabilities(void *priv, char *data, size_t len) } static int gb_camera_op_configure_streams(void *priv, unsigned int *nstreams, - unsigned int *flags, struct gb_camera_stream *streams, - struct gb_camera_csi_params *csi_params) + unsigned int *flags, struct gb_camera_stream *streams, + struct gb_camera_csi_params *csi_params) { struct gb_camera *gcam = priv; struct gb_camera_stream_config *gb_streams; diff --git a/drivers/staging/greybus/fw-management.c b/drivers/staging/greybus/fw-management.c index cd9141e4b7..93137a3c49 100644 --- a/drivers/staging/greybus/fw-management.c +++ b/drivers/staging/greybus/fw-management.c @@ -55,7 +55,10 @@ struct fw_mgmt { */ #define NUM_MINORS U8_MAX -static struct class *fw_mgmt_class; +static const struct class fw_mgmt_class = { + .name = "gb_fw_mgmt", +}; + static dev_t fw_mgmt_dev_num; static DEFINE_IDA(fw_mgmt_minors_map); static LIST_HEAD(fw_mgmt_list); @@ -629,7 +632,7 @@ int gb_fw_mgmt_connection_init(struct gb_connection *connection) goto err_remove_ida; /* Add a soft link to the previously added char-dev within the bundle */ - fw_mgmt->class_device = device_create(fw_mgmt_class, fw_mgmt->parent, + fw_mgmt->class_device = device_create(&fw_mgmt_class, fw_mgmt->parent, fw_mgmt->dev_num, NULL, "gb-fw-mgmt-%d", minor); if (IS_ERR(fw_mgmt->class_device)) { @@ -664,7 +667,7 @@ void gb_fw_mgmt_connection_exit(struct gb_connection *connection) fw_mgmt = gb_connection_get_data(connection); - device_destroy(fw_mgmt_class, fw_mgmt->dev_num); + device_destroy(&fw_mgmt_class, fw_mgmt->dev_num); cdev_del(&fw_mgmt->cdev); ida_simple_remove(&fw_mgmt_minors_map, MINOR(fw_mgmt->dev_num)); @@ -696,9 +699,9 @@ int fw_mgmt_init(void) { int ret; - fw_mgmt_class = class_create("gb_fw_mgmt"); - if (IS_ERR(fw_mgmt_class)) - return PTR_ERR(fw_mgmt_class); + ret = class_register(&fw_mgmt_class); + if (ret) + return ret; ret = alloc_chrdev_region(&fw_mgmt_dev_num, 0, NUM_MINORS, "gb_fw_mgmt"); @@ -708,13 +711,13 @@ int fw_mgmt_init(void) return 0; err_remove_class: - class_destroy(fw_mgmt_class); + class_unregister(&fw_mgmt_class); return ret; } void fw_mgmt_exit(void) { unregister_chrdev_region(fw_mgmt_dev_num, NUM_MINORS); - class_destroy(fw_mgmt_class); + class_unregister(&fw_mgmt_class); ida_destroy(&fw_mgmt_minors_map); } diff --git a/drivers/staging/greybus/pwm.c b/drivers/staging/greybus/pwm.c index 57cc1960d0..a3cb68cfa0 100644 --- a/drivers/staging/greybus/pwm.c +++ b/drivers/staging/greybus/pwm.c @@ -258,7 +258,6 @@ static const struct pwm_ops gb_pwm_ops = { .request = gb_pwm_request, .free = gb_pwm_free, .apply = gb_pwm_apply, - .owner = THIS_MODULE, }; static int gb_pwm_probe(struct gbphy_device *gbphy_dev, diff --git a/drivers/staging/greybus/raw.c b/drivers/staging/greybus/raw.c index 8bca8cb12c..b9c6eff7cd 100644 --- a/drivers/staging/greybus/raw.c +++ b/drivers/staging/greybus/raw.c @@ -29,10 +29,13 @@ struct gb_raw { struct raw_data { struct list_head entry; u32 len; - u8 data[]; + u8 data[] __counted_by(len); +}; + +static const struct class raw_class = { + .name = "gb_raw", }; -static struct class *raw_class; static int raw_major; static const struct file_operations raw_fops; static DEFINE_IDA(minors); @@ -70,7 +73,7 @@ static int receive_data(struct gb_raw *raw, u32 len, u8 *data) goto exit; } - raw_data = kmalloc(sizeof(*raw_data) + len, GFP_KERNEL); + raw_data = kmalloc(struct_size(raw_data, data, len), GFP_KERNEL); if (!raw_data) { retval = -ENOMEM; goto exit; @@ -195,7 +198,7 @@ static int gb_raw_probe(struct gb_bundle *bundle, if (retval) goto error_connection_disable; - raw->device = device_create(raw_class, &connection->bundle->dev, + raw->device = device_create(&raw_class, &connection->bundle->dev, raw->dev, raw, "gb!raw%d", minor); if (IS_ERR(raw->device)) { retval = PTR_ERR(raw->device); @@ -229,7 +232,7 @@ static void gb_raw_disconnect(struct gb_bundle *bundle) struct raw_data *temp; // FIXME - handle removing a connection when the char device node is open. - device_destroy(raw_class, raw->dev); + device_destroy(&raw_class, raw->dev); cdev_del(&raw->cdev); gb_connection_disable(connection); ida_simple_remove(&minors, MINOR(raw->dev)); @@ -340,11 +343,9 @@ static int raw_init(void) dev_t dev; int retval; - raw_class = class_create("gb_raw"); - if (IS_ERR(raw_class)) { - retval = PTR_ERR(raw_class); + retval = class_register(&raw_class); + if (retval) goto error_class; - } retval = alloc_chrdev_region(&dev, 0, NUM_MINORS, "gb_raw"); if (retval < 0) @@ -361,7 +362,7 @@ static int raw_init(void) error_gb: unregister_chrdev_region(dev, NUM_MINORS); error_chrdev: - class_destroy(raw_class); + class_unregister(&raw_class); error_class: return retval; } @@ -371,7 +372,7 @@ static void __exit raw_exit(void) { greybus_deregister(&gb_raw_driver); unregister_chrdev_region(MKDEV(raw_major, 0), NUM_MINORS); - class_destroy(raw_class); + class_unregister(&raw_class); ida_destroy(&minors); } module_exit(raw_exit); |