summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2017-12-05 23:17:09 +0100
committerSudeep Holla <sudeep.holla@arm.com>2018-02-23 15:12:56 +0000
commitc10bd41ab0b2508a98651ab3e4e9fbc85425eaad (patch)
treedf51fd5b947fc0c2f27583dafc7f6a13f10ebfe5 /drivers/firmware
parent27901cccf8dd7b9e8d77c2637a2b306d731e567d (diff)
downloadtalos-op-linux-c10bd41ab0b2508a98651ab3e4e9fbc85425eaad.tar.gz
talos-op-linux-c10bd41ab0b2508a98651ab3e4e9fbc85425eaad.zip
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. Tested-by: Kevin Hilman <khilman@baylibre.com> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Diffstat (limited to 'drivers/firmware')
-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 e02d58208a94..3a722e5a6666 100644
--- a/drivers/firmware/arm_scpi.c
+++ b/drivers/firmware/arm_scpi.c
@@ -304,10 +304,6 @@ struct clk_get_info {
u8 name[20];
} __packed;
-struct clk_get_value {
- __le32 rate;
-} __packed;
-
struct clk_set_value {
__le16 id;
__le16 reserved;
@@ -346,10 +342,6 @@ struct _scpi_sensor_info {
char name[20];
};
-struct sensor_value {
- __le64 val;
-};
-
struct dev_pstate_set {
__le16 dev_id;
u8 pstate;
@@ -577,13 +569,13 @@ scpi_clk_get_range(u16 clk_id, unsigned long *min, unsigned long *max)
static unsigned long scpi_clk_get_val(u16 clk_id)
{
int ret;
- struct clk_get_value clk;
+ __le32 rate;
__le16 le_clk_id = cpu_to_le16(clk_id);
ret = scpi_send_message(CMD_GET_CLOCK_VALUE, &le_clk_id,
- sizeof(le_clk_id), &clk, sizeof(clk));
+ sizeof(le_clk_id), &rate, sizeof(rate));
- return ret ? ret : le32_to_cpu(clk.rate);
+ return ret ? ret : le32_to_cpu(rate);
}
static int scpi_clk_set_val(u16 clk_id, unsigned long rate)
@@ -767,19 +759,19 @@ static int scpi_sensor_get_info(u16 sensor_id, struct scpi_sensor_info *info)
static int scpi_sensor_get_value(u16 sensor, u64 *val)
{
__le16 id = cpu_to_le16(sensor);
- struct sensor_value buf;
+ __le64 value;
int ret;
ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id),
- &buf, sizeof(buf));
+ &value, sizeof(value));
if (ret)
return ret;
if (scpi_info->is_legacy)
/* only 32-bits supported, upper 32 bits can be junk */
- *val = le32_to_cpup((__le32 *)&buf.val);
+ *val = le32_to_cpup((__le32 *)&value);
else
- *val = le64_to_cpu(buf.val);
+ *val = le64_to_cpu(value);
return 0;
}
OpenPOWER on IntegriCloud