mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-22 13:54:57 +08:00
tty: hvc-iucv: fix function pointer casts
clang warns about explicitly casting between incompatible function pointers: drivers/tty/hvc/hvc_iucv.c:1100:23: error: cast from 'void (*)(const void *)' to 'void (*)(struct device *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 1100 | priv->dev->release = (void (*)(struct device *)) kfree; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Add a separate function to handle this correctly. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jiri Slaby <jirislaby@kernel.org> Link: https://lore.kernel.org/r/20240213101756.461701-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8524788abf
commit
42af6bcbc3
@ -1035,6 +1035,10 @@ static const struct attribute_group *hvc_iucv_dev_attr_groups[] = {
|
|||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void hvc_iucv_free(struct device *data)
|
||||||
|
{
|
||||||
|
kfree(data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* hvc_iucv_alloc() - Allocates a new struct hvc_iucv_private instance
|
* hvc_iucv_alloc() - Allocates a new struct hvc_iucv_private instance
|
||||||
@ -1097,7 +1101,7 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console)
|
|||||||
priv->dev->bus = &iucv_bus;
|
priv->dev->bus = &iucv_bus;
|
||||||
priv->dev->parent = iucv_root;
|
priv->dev->parent = iucv_root;
|
||||||
priv->dev->groups = hvc_iucv_dev_attr_groups;
|
priv->dev->groups = hvc_iucv_dev_attr_groups;
|
||||||
priv->dev->release = (void (*)(struct device *)) kfree;
|
priv->dev->release = hvc_iucv_free;
|
||||||
rc = device_register(priv->dev);
|
rc = device_register(priv->dev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
put_device(priv->dev);
|
put_device(priv->dev);
|
||||||
|
Loading…
Reference in New Issue
Block a user