aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2017-10-05 06:40:49 -0400
committerSudeep Holla <sudeep.holla@arm.com>2017-10-09 05:17:41 -0400
commit48bee74a354b211c4e4cb62e6a7b7986749747cf (patch)
tree9c301524fefde4358aa6d7b135655cdbb02fa480
parent1b36633ea9c80f91fab505002dd7548febc51812 (diff)
firmware: arm_scpi: remove all single element structures
Both clk_get_value and sensor_value structures contains a single element and hence needs no packing making the whole structure defination unnecessary. This patch gets rid of both those unnecessary structures. Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
-rw-r--r--drivers/firmware/arm_scpi.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/firmware/arm_scpi.c b/drivers/firmware/arm_scpi.c
index a888970f1347..f0c37a4ecddf 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -304,10 +304,6 @@ struct clk_get_info {
304 u8 name[20]; 304 u8 name[20];
305} __packed; 305} __packed;
306 306
307struct clk_get_value {
308 __le32 rate;
309} __packed;
310
311struct clk_set_value { 307struct clk_set_value {
312 __le16 id; 308 __le16 id;
313 __le16 reserved; 309 __le16 reserved;
@@ -346,10 +342,6 @@ struct _scpi_sensor_info {
346 char name[20]; 342 char name[20];
347}; 343};
348 344
349struct sensor_value {
350 __le64 val;
351};
352
353struct dev_pstate_set { 345struct dev_pstate_set {
354 __le16 dev_id; 346 __le16 dev_id;
355 u8 pstate; 347 u8 pstate;
@@ -577,13 +569,13 @@ scpi_clk_get_range(u16 clk_id, unsigned long *min, unsigned long *max)
577static unsigned long scpi_clk_get_val(u16 clk_id) 569static unsigned long scpi_clk_get_val(u16 clk_id)
578{ 570{
579 int ret; 571 int ret;
580 struct clk_get_value clk; 572 __le32 rate;
581 __le16 le_clk_id = cpu_to_le16(clk_id); 573 __le16 le_clk_id = cpu_to_le16(clk_id);
582 574
583 ret = scpi_send_message(CMD_GET_CLOCK_VALUE, &le_clk_id, 575 ret = scpi_send_message(CMD_GET_CLOCK_VALUE, &le_clk_id,
584 sizeof(le_clk_id), &clk, sizeof(clk)); 576 sizeof(le_clk_id), &rate, sizeof(rate));
585 577
586 return ret ? ret : le32_to_cpu(clk.rate); 578 return ret ? ret : le32_to_cpu(rate);
587} 579}
588 580
589static int scpi_clk_set_val(u16 clk_id, unsigned long rate) 581static int scpi_clk_set_val(u16 clk_id, unsigned long rate)
@@ -775,19 +767,19 @@ static int scpi_sensor_get_info(u16 sensor_id, struct scpi_sensor_info *info)
775static int scpi_sensor_get_value(u16 sensor, u64 *val) 767static int scpi_sensor_get_value(u16 sensor, u64 *val)
776{ 768{
777 __le16 id = cpu_to_le16(sensor); 769 __le16 id = cpu_to_le16(sensor);
778 struct sensor_value buf; 770 __le64 value;
779 int ret; 771 int ret;
780 772
781 ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id), 773 ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id),
782 &buf, sizeof(buf)); 774 &value, sizeof(value));
783 if (ret) 775 if (ret)
784 return ret; 776 return ret;
785 777
786 if (scpi_info->is_legacy) 778 if (scpi_info->is_legacy)
787 /* only 32-bits supported, upper 32 bits can be junk */ 779 /* only 32-bits supported, upper 32 bits can be junk */
788 *val = le32_to_cpup((__le32 *)&buf.val); 780 *val = le32_to_cpup((__le32 *)&value);
789 else 781 else
790 *val = le64_to_cpu(buf.val); 782 *val = le64_to_cpu(value);
791 783
792 return 0; 784 return 0;
793} 785}