mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-08-31 22:23:05 +00:00
greybus: svc: drop legacy-protocol dependency
Drop dependency on the legacy protocol abstraction. Remove the now unused and last legacy-protocol flag GB_PROTOCOL_SKIP_VERSION along with the protocol-flag feature. Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
e217ae762b
commit
84427943d2
@ -341,17 +341,12 @@ gb_connection_control_disconnected(struct gb_connection *connection)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request protocol version supported by the module. We don't need to do
|
* Request protocol version supported by the module.
|
||||||
* this for SVC as that is initiated by the SVC.
|
|
||||||
*/
|
*/
|
||||||
static int gb_connection_protocol_get_version(struct gb_connection *connection)
|
static int gb_connection_protocol_get_version(struct gb_connection *connection)
|
||||||
{
|
{
|
||||||
struct gb_protocol *protocol = connection->protocol;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (protocol->flags & GB_PROTOCOL_SKIP_VERSION)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ret = gb_protocol_get_version(connection);
|
ret = gb_protocol_get_version(connection);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
dev_err(&connection->hd->dev,
|
dev_err(&connection->hd->dev,
|
||||||
|
@ -234,12 +234,6 @@ static int __init gb_init(void)
|
|||||||
goto error_operation;
|
goto error_operation;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = gb_svc_protocol_init();
|
|
||||||
if (retval) {
|
|
||||||
pr_err("gb_svc_protocol_init failed\n");
|
|
||||||
goto error_svc;
|
|
||||||
}
|
|
||||||
|
|
||||||
retval = gb_firmware_protocol_init();
|
retval = gb_firmware_protocol_init();
|
||||||
if (retval) {
|
if (retval) {
|
||||||
pr_err("gb_firmware_protocol_init failed\n");
|
pr_err("gb_firmware_protocol_init failed\n");
|
||||||
@ -257,8 +251,6 @@ static int __init gb_init(void)
|
|||||||
error_legacy:
|
error_legacy:
|
||||||
gb_firmware_protocol_exit();
|
gb_firmware_protocol_exit();
|
||||||
error_firmware:
|
error_firmware:
|
||||||
gb_svc_protocol_exit();
|
|
||||||
error_svc:
|
|
||||||
gb_operation_exit();
|
gb_operation_exit();
|
||||||
error_operation:
|
error_operation:
|
||||||
gb_hd_exit();
|
gb_hd_exit();
|
||||||
@ -275,7 +267,6 @@ static void __exit gb_exit(void)
|
|||||||
{
|
{
|
||||||
gb_legacy_exit();
|
gb_legacy_exit();
|
||||||
gb_firmware_protocol_exit();
|
gb_firmware_protocol_exit();
|
||||||
gb_svc_protocol_exit();
|
|
||||||
gb_operation_exit();
|
gb_operation_exit();
|
||||||
gb_hd_exit();
|
gb_hd_exit();
|
||||||
bus_unregister(&greybus_bus_type);
|
bus_unregister(&greybus_bus_type);
|
||||||
|
@ -13,9 +13,6 @@
|
|||||||
struct gb_connection;
|
struct gb_connection;
|
||||||
struct gb_operation;
|
struct gb_operation;
|
||||||
|
|
||||||
/* Possible flags for protocol drivers */
|
|
||||||
#define GB_PROTOCOL_SKIP_VERSION BIT(3) /* Don't send get_version() requests */
|
|
||||||
|
|
||||||
typedef int (*gb_connection_init_t)(struct gb_connection *);
|
typedef int (*gb_connection_init_t)(struct gb_connection *);
|
||||||
typedef void (*gb_connection_exit_t)(struct gb_connection *);
|
typedef void (*gb_connection_exit_t)(struct gb_connection *);
|
||||||
typedef int (*gb_request_recv_t)(u8, struct gb_operation *);
|
typedef int (*gb_request_recv_t)(u8, struct gb_operation *);
|
||||||
@ -30,7 +27,6 @@ struct gb_protocol {
|
|||||||
u8 major;
|
u8 major;
|
||||||
u8 minor;
|
u8 minor;
|
||||||
u8 count;
|
u8 count;
|
||||||
unsigned long flags;
|
|
||||||
|
|
||||||
struct list_head links; /* global list */
|
struct list_head links; /* global list */
|
||||||
|
|
||||||
|
@ -690,10 +690,11 @@ static int gb_svc_intf_reset_recv(struct gb_operation *op)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gb_svc_request_recv(u8 type, struct gb_operation *op)
|
static int gb_svc_request_handler(struct gb_operation *op)
|
||||||
{
|
{
|
||||||
struct gb_connection *connection = op->connection;
|
struct gb_connection *connection = op->connection;
|
||||||
struct gb_svc *svc = connection->private;
|
struct gb_svc *svc = connection->private;
|
||||||
|
u8 type = op->type;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -815,7 +816,7 @@ int gb_svc_add(struct gb_svc *svc)
|
|||||||
* is added from the connection request handler when enough
|
* is added from the connection request handler when enough
|
||||||
* information has been received.
|
* information has been received.
|
||||||
*/
|
*/
|
||||||
ret = gb_connection_legacy_init(svc->connection);
|
ret = gb_connection_enable(svc->connection, gb_svc_request_handler);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -830,7 +831,7 @@ void gb_svc_del(struct gb_svc *svc)
|
|||||||
if (device_is_registered(&svc->dev))
|
if (device_is_registered(&svc->dev))
|
||||||
device_del(&svc->dev);
|
device_del(&svc->dev);
|
||||||
|
|
||||||
gb_connection_legacy_exit(svc->connection);
|
gb_connection_disable(svc->connection);
|
||||||
|
|
||||||
flush_workqueue(svc->wq);
|
flush_workqueue(svc->wq);
|
||||||
}
|
}
|
||||||
@ -839,31 +840,3 @@ void gb_svc_put(struct gb_svc *svc)
|
|||||||
{
|
{
|
||||||
put_device(&svc->dev);
|
put_device(&svc->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int gb_svc_connection_init(struct gb_connection *connection)
|
|
||||||
{
|
|
||||||
struct gb_svc *svc = connection->private;
|
|
||||||
|
|
||||||
dev_dbg(&svc->dev, "%s\n", __func__);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void gb_svc_connection_exit(struct gb_connection *connection)
|
|
||||||
{
|
|
||||||
struct gb_svc *svc = connection->private;
|
|
||||||
|
|
||||||
dev_dbg(&svc->dev, "%s\n", __func__);
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct gb_protocol svc_protocol = {
|
|
||||||
.name = "svc",
|
|
||||||
.id = GREYBUS_PROTOCOL_SVC,
|
|
||||||
.major = GB_SVC_VERSION_MAJOR,
|
|
||||||
.minor = GB_SVC_VERSION_MINOR,
|
|
||||||
.connection_init = gb_svc_connection_init,
|
|
||||||
.connection_exit = gb_svc_connection_exit,
|
|
||||||
.request_recv = gb_svc_request_recv,
|
|
||||||
.flags = GB_PROTOCOL_SKIP_VERSION,
|
|
||||||
};
|
|
||||||
gb_builtin_protocol_driver(svc_protocol);
|
|
||||||
|
Loading…
Reference in New Issue
Block a user