From patchwork Wed Dec 2 20:40:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 11947149 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 237C9C6369E for ; Wed, 2 Dec 2020 21:00:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 978D822206 for ; Wed, 2 Dec 2020 21:00:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 978D822206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uKMfTDzPMXFbqIYDkTUH47Oc+WsFc8nPMOMUi6p3VEI=; b=jxh1Rj3n9toeqb0Hb2rMSdCd3+ U31qZQgjR8CuE3+FL7+C3KcHB8AtzhVVLgGlec6CDHMaaXqlFCzJ459VcUKPvB2zXsabt5u7h/sfJ ycPRP/0/fYkQaPVJTA4XzAfWmSaH8xujobEOTmFkG+stpmET3oXu8sC5tWIy/IR8gyVrIfckV+gLC wwVygpw+nEy3Qq8LQho2swYSfpVzqEVUUCMyTv0ET5YDMynrxc69fNcJWgWSSqU1E/nWQNZWtj2je SuTF+keJCUo+hW43JM4kO34cKPb0v/gdgZ6CjNtNOcFRRlYHPbGC4PIyGTmCN1xTy9FmxDtu8oyqZ DrLq5F3w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkZD5-0000iV-PZ; Wed, 02 Dec 2020 20:58:47 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkYwT-0002bA-AG for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2020 20:41:39 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2E93115DB; Wed, 2 Dec 2020 12:41:37 -0800 (PST) Received: from e120937-lin.home (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 722B33F575; Wed, 2 Dec 2020 12:41:35 -0800 (PST) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 34/37] firmware: arm_scmi: cleanup events registration transient code Date: Wed, 2 Dec 2020 20:40:06 +0000 Message-Id: <20201202204009.32073-35-cristian.marussi@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201202204009.32073-1-cristian.marussi@arm.com> References: <20201202204009.32073-1-cristian.marussi@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201202_154137_653907_37B930F9 X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: f.fainelli@gmail.com, vincent.guittot@linaro.org, sudeep.holla@arm.com, thara.gopinath@linaro.org, Cristian Marussi , james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, souvik.chakravarty@arm.com, etienne.carriere@linaro.org, lukasz.luba@arm.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Remove all the events registration code used to ease the transition to the new interface based on protocol handles.. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/base.c | 4 ++-- drivers/firmware/arm_scmi/notify.h | 6 +++--- drivers/firmware/arm_scmi/perf.c | 9 ++++----- drivers/firmware/arm_scmi/power.c | 16 ++++++++-------- drivers/firmware/arm_scmi/reset.c | 16 ++++++++-------- drivers/firmware/arm_scmi/sensors.c | 19 +++++++++---------- drivers/firmware/arm_scmi/system.c | 11 ++++++----- 7 files changed, 40 insertions(+), 41 deletions(-) diff --git a/drivers/firmware/arm_scmi/base.c b/drivers/firmware/arm_scmi/base.c index c9e5e451b377..f2d10c5a55ae 100644 --- a/drivers/firmware/arm_scmi/base.c +++ b/drivers/firmware/arm_scmi/base.c @@ -264,7 +264,7 @@ static int scmi_base_error_notify(const struct scmi_protocol_handle *ph, return ret; } -static int scmi_base_set_notify_enabled(const void *ph, +static int scmi_base_set_notify_enabled(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enable) { int ret; @@ -276,7 +276,7 @@ static int scmi_base_set_notify_enabled(const void *ph, return ret; } -static void *scmi_base_fill_custom_report(const void *ph, +static void *scmi_base_fill_custom_report(const struct scmi_protocol_handle *ph, u8 evt_id, ktime_t timestamp, const void *payld, size_t payld_sz, void *report, u32 *src_id) diff --git a/drivers/firmware/arm_scmi/notify.h b/drivers/firmware/arm_scmi/notify.h index 2281a740ae96..3915bcd76242 100644 --- a/drivers/firmware/arm_scmi/notify.h +++ b/drivers/firmware/arm_scmi/notify.h @@ -50,10 +50,10 @@ struct scmi_protocol_handle; * process context. */ struct scmi_event_ops { - int (*get_num_sources)(const void *handle); - int (*set_notify_enabled)(const void *handle, + int (*get_num_sources)(const struct scmi_protocol_handle *ph); + int (*set_notify_enabled)(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enabled); - void *(*fill_custom_report)(const void *handle, + void *(*fill_custom_report)(const struct scmi_protocol_handle *ph, u8 evt_id, ktime_t timestamp, const void *payld, size_t payld_sz, void *report, u32 *src_id); diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c index 9cfc42c8fffd..49a33fc1c319 100644 --- a/drivers/firmware/arm_scmi/perf.c +++ b/drivers/firmware/arm_scmi/perf.c @@ -761,7 +761,7 @@ static const struct scmi_perf_proto_ops perf_proto_ops = { .fast_switch_possible = scmi_fast_switch_possible, }; -static int scmi_perf_set_notify_enabled(const void *ph, +static int scmi_perf_set_notify_enabled(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enable) { int ret, cmd_id; @@ -778,7 +778,7 @@ static int scmi_perf_set_notify_enabled(const void *ph, return ret; } -static void *scmi_perf_fill_custom_report(const void *ph, +static void *scmi_perf_fill_custom_report(const struct scmi_protocol_handle *ph, u8 evt_id, ktime_t timestamp, const void *payld, size_t payld_sz, void *report, u32 *src_id) @@ -826,10 +826,9 @@ static void *scmi_perf_fill_custom_report(const void *ph, return rep; } -static int scmi_perf_get_num_sources(const void *ph) +static int scmi_perf_get_num_sources(const struct scmi_protocol_handle *ph) { - struct scmi_perf_info *pi = - ((const struct scmi_protocol_handle *)ph)->get_priv(ph); + struct scmi_perf_info *pi = ph->get_priv(ph); if (!pi) return -EINVAL; diff --git a/drivers/firmware/arm_scmi/power.c b/drivers/firmware/arm_scmi/power.c index 06e3ab17a0eb..3e453d9bcbc8 100644 --- a/drivers/firmware/arm_scmi/power.c +++ b/drivers/firmware/arm_scmi/power.c @@ -211,7 +211,7 @@ static int scmi_power_request_notify(const struct scmi_protocol_handle *ph, return ret; } -static int scmi_power_set_notify_enabled(const void *ph, +static int scmi_power_set_notify_enabled(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enable) { int ret; @@ -224,10 +224,11 @@ static int scmi_power_set_notify_enabled(const void *ph, return ret; } -static void *scmi_power_fill_custom_report(const void *ph, - u8 evt_id, ktime_t timestamp, - const void *payld, size_t payld_sz, - void *report, u32 *src_id) +static void * +scmi_power_fill_custom_report(const struct scmi_protocol_handle *ph, + u8 evt_id, ktime_t timestamp, + const void *payld, size_t payld_sz, + void *report, u32 *src_id) { const struct scmi_power_state_notify_payld *p = payld; struct scmi_power_state_changed_report *r = report; @@ -244,10 +245,9 @@ static void *scmi_power_fill_custom_report(const void *ph, return r; } -static int scmi_power_get_num_sources(const void *ph) +static int scmi_power_get_num_sources(const struct scmi_protocol_handle *ph) { - struct scmi_power_info *pinfo = - ((const struct scmi_protocol_handle *)ph)->get_priv(ph); + struct scmi_power_info *pinfo = ph->get_priv(ph); if (!pinfo) return -EINVAL; diff --git a/drivers/firmware/arm_scmi/reset.c b/drivers/firmware/arm_scmi/reset.c index 3856ceed2bd7..bd28d4e9664d 100644 --- a/drivers/firmware/arm_scmi/reset.c +++ b/drivers/firmware/arm_scmi/reset.c @@ -225,7 +225,7 @@ static int scmi_reset_notify(const struct scmi_protocol_handle *ph, return ret; } -static int scmi_reset_set_notify_enabled(const void *ph, +static int scmi_reset_set_notify_enabled(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enable) { int ret; @@ -238,10 +238,11 @@ static int scmi_reset_set_notify_enabled(const void *ph, return ret; } -static void *scmi_reset_fill_custom_report(const void *ph, - u8 evt_id, ktime_t timestamp, - const void *payld, size_t payld_sz, - void *report, u32 *src_id) +static void * +scmi_reset_fill_custom_report(const struct scmi_protocol_handle *ph, + u8 evt_id, ktime_t timestamp, + const void *payld, size_t payld_sz, + void *report, u32 *src_id) { const struct scmi_reset_issued_notify_payld *p = payld; struct scmi_reset_issued_report *r = report; @@ -258,10 +259,9 @@ static void *scmi_reset_fill_custom_report(const void *ph, return r; } -static int scmi_reset_get_num_sources(const void *ph) +static int scmi_reset_get_num_sources(const struct scmi_protocol_handle *ph) { - struct scmi_reset_info *pinfo = - ((const struct scmi_protocol_handle *)ph)->get_priv(ph); + struct scmi_reset_info *pinfo = ph->get_priv(ph); if (!pinfo) return -EINVAL; diff --git a/drivers/firmware/arm_scmi/sensors.c b/drivers/firmware/arm_scmi/sensors.c index 478585f644fa..edc08d9f8daa 100644 --- a/drivers/firmware/arm_scmi/sensors.c +++ b/drivers/firmware/arm_scmi/sensors.c @@ -834,7 +834,7 @@ static const struct scmi_sensor_proto_ops sensor_proto_ops = { .config_set = scmi_sensor_config_set, }; -static int scmi_sensor_set_notify_enabled(const void *ph, +static int scmi_sensor_set_notify_enabled(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enable) { int ret; @@ -858,10 +858,11 @@ static int scmi_sensor_set_notify_enabled(const void *ph, return ret; } -static void *scmi_sensor_fill_custom_report(const void *ph, - u8 evt_id, ktime_t timestamp, - const void *payld, size_t payld_sz, - void *report, u32 *src_id) +static void * +scmi_sensor_fill_custom_report(const struct scmi_protocol_handle *ph, + u8 evt_id, ktime_t timestamp, + const void *payld, size_t payld_sz, + void *report, u32 *src_id) { void *rep = NULL; @@ -888,8 +889,7 @@ static void *scmi_sensor_fill_custom_report(const void *ph, struct scmi_sensor_info *s; const struct scmi_sensor_update_notify_payld *p = payld; struct scmi_sensor_update_report *r = report; - struct sensors_info *sinfo = - ((const struct scmi_protocol_handle *)ph)->get_priv(ph); + struct sensors_info *sinfo = ph->get_priv(ph); /* payld_sz is variable for this event */ r->sensor_id = le32_to_cpu(p->sensor_id); @@ -919,10 +919,9 @@ static void *scmi_sensor_fill_custom_report(const void *ph, return rep; } -static int scmi_sensor_get_num_sources(const void *ph) +static int scmi_sensor_get_num_sources(const struct scmi_protocol_handle *ph) { - struct sensors_info *si = - ((const struct scmi_protocol_handle *)ph)->get_priv(ph); + struct sensors_info *si = ph->get_priv(ph); return si->num_sensors; } diff --git a/drivers/firmware/arm_scmi/system.c b/drivers/firmware/arm_scmi/system.c index a23c1f505b56..97ad20a51d72 100644 --- a/drivers/firmware/arm_scmi/system.c +++ b/drivers/firmware/arm_scmi/system.c @@ -53,7 +53,7 @@ static int scmi_system_request_notify(const struct scmi_protocol_handle *ph, return ret; } -static int scmi_system_set_notify_enabled(const void *ph, +static int scmi_system_set_notify_enabled(const struct scmi_protocol_handle *ph, u8 evt_id, u32 src_id, bool enable) { int ret; @@ -65,10 +65,11 @@ static int scmi_system_set_notify_enabled(const void *ph, return ret; } -static void *scmi_system_fill_custom_report(const void *ph, - u8 evt_id, ktime_t timestamp, - const void *payld, size_t payld_sz, - void *report, u32 *src_id) +static void * +scmi_system_fill_custom_report(const struct scmi_protocol_handle *ph, + u8 evt_id, ktime_t timestamp, + const void *payld, size_t payld_sz, + void *report, u32 *src_id) { const struct scmi_system_power_state_notifier_payld *p = payld; struct scmi_system_power_state_notifier_report *r = report;