Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

firmware: arm_scmi: Remove legacy scmi_reset_ops protocol interface

Now that all the SCMI driver users have been migrated to the new interface
remove the legacy interface and all the transient code.

Link: https://lore.kernel.org/r/20210316124903.35011-23-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

authored by

Cristian Marussi and committed by
Sudeep Holla
497ef0cb 35cc2630

-79
-68
drivers/firmware/arm_scmi/reset.c
··· 125 125 return pi->num_domains; 126 126 } 127 127 128 - static int __scmi_reset_num_domains_get(const struct scmi_handle *handle) 129 - { 130 - const struct scmi_protocol_handle *ph = 131 - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_RESET); 132 - 133 - return scmi_reset_num_domains_get(ph); 134 - } 135 - 136 128 static char *scmi_reset_name_get(const struct scmi_protocol_handle *ph, 137 129 u32 domain) 138 130 { ··· 135 143 return dom->name; 136 144 } 137 145 138 - static char *__scmi_reset_name_get(const struct scmi_handle *handle, 139 - u32 domain) 140 - { 141 - const struct scmi_protocol_handle *ph = 142 - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_RESET); 143 - 144 - return scmi_reset_name_get(ph, domain); 145 - } 146 - 147 146 static int scmi_reset_latency_get(const struct scmi_protocol_handle *ph, 148 147 u32 domain) 149 148 { ··· 142 159 struct reset_dom_info *dom = pi->dom_info + domain; 143 160 144 161 return dom->latency_us; 145 - } 146 - 147 - static int __scmi_reset_latency_get(const struct scmi_handle *handle, 148 - u32 domain) 149 - { 150 - const struct scmi_protocol_handle *ph = 151 - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_RESET); 152 - 153 - return scmi_reset_latency_get(ph, domain); 154 162 } 155 163 156 164 static int scmi_domain_reset(const struct scmi_protocol_handle *ph, u32 domain, ··· 181 207 ARCH_COLD_RESET); 182 208 } 183 209 184 - static int __scmi_reset_domain_reset(const struct scmi_handle *handle, 185 - u32 domain) 186 - { 187 - const struct scmi_protocol_handle *ph = 188 - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_RESET); 189 - 190 - return scmi_reset_domain_reset(ph, domain); 191 - } 192 - 193 210 static int 194 211 scmi_reset_domain_assert(const struct scmi_protocol_handle *ph, u32 domain) 195 212 { ··· 189 224 } 190 225 191 226 static int 192 - __scmi_reset_domain_assert(const struct scmi_handle *handle, u32 domain) 193 - { 194 - const struct scmi_protocol_handle *ph = 195 - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_RESET); 196 - 197 - return scmi_reset_domain_assert(ph, domain); 198 - } 199 - 200 - static int 201 227 scmi_reset_domain_deassert(const struct scmi_protocol_handle *ph, u32 domain) 202 228 { 203 229 return scmi_domain_reset(ph, domain, 0, ARCH_COLD_RESET); 204 230 } 205 - 206 - static int 207 - __scmi_reset_domain_deassert(const struct scmi_handle *handle, u32 domain) 208 - { 209 - const struct scmi_protocol_handle *ph = 210 - scmi_map_protocol_handle(handle, SCMI_PROTOCOL_RESET); 211 - 212 - return scmi_reset_domain_deassert(ph, domain); 213 - } 214 - 215 - static const struct scmi_reset_ops reset_ops = { 216 - .num_domains_get = __scmi_reset_num_domains_get, 217 - .name_get = __scmi_reset_name_get, 218 - .latency_get = __scmi_reset_latency_get, 219 - .reset = __scmi_reset_domain_reset, 220 - .assert = __scmi_reset_domain_assert, 221 - .deassert = __scmi_reset_domain_deassert, 222 - }; 223 231 224 232 static const struct scmi_reset_proto_ops reset_proto_ops = { 225 233 .num_domains_get = scmi_reset_num_domains_get, ··· 295 357 int domain; 296 358 u32 version; 297 359 struct scmi_reset_info *pinfo; 298 - struct scmi_handle *handle; 299 360 300 361 ph->xops->version_get(ph, &version); 301 362 ··· 319 382 } 320 383 321 384 pinfo->version = version; 322 - 323 - /* Transient code for legacy ops interface */ 324 - handle = scmi_map_scmi_handle(ph); 325 - handle->reset_ops = &reset_ops; 326 - 327 385 return ph->set_priv(ph, pinfo); 328 386 } 329 387
-11
include/linux/scmi_protocol.h
··· 483 483 int (*deassert)(const struct scmi_protocol_handle *ph, u32 domain); 484 484 }; 485 485 486 - struct scmi_reset_ops { 487 - int (*num_domains_get)(const struct scmi_handle *handle); 488 - char *(*name_get)(const struct scmi_handle *handle, u32 domain); 489 - int (*latency_get)(const struct scmi_handle *handle, u32 domain); 490 - int (*reset)(const struct scmi_handle *handle, u32 domain); 491 - int (*assert)(const struct scmi_handle *handle, u32 domain); 492 - int (*deassert)(const struct scmi_handle *handle, u32 domain); 493 - }; 494 - 495 486 /** 496 487 * struct scmi_voltage_info - describe one available SCMI Voltage Domain 497 488 * ··· 606 615 * @dev: pointer to the SCMI device 607 616 * @version: pointer to the structure containing SCMI version information 608 617 * @sensor_ops: pointer to set of sensor protocol operations 609 - * @reset_ops: pointer to set of reset protocol operations 610 618 * @voltage_ops: pointer to set of voltage protocol operations 611 619 * @devm_protocol_get: devres managed method to acquire a protocol and get specific 612 620 * operations and a dedicated protocol handler ··· 622 632 struct device *dev; 623 633 struct scmi_revision_info *version; 624 634 const struct scmi_sensor_ops *sensor_ops; 625 - const struct scmi_reset_ops *reset_ops; 626 635 const struct scmi_voltage_ops *voltage_ops; 627 636 628 637 const void __must_check *