Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48bee74a authored by Sudeep Holla's avatar Sudeep Holla
Browse files

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: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 1b36633e
Loading
Loading
Loading
Loading
+7 −15
Original line number Original line Diff line number Diff line
@@ -304,10 +304,6 @@ struct clk_get_info {
	u8 name[20];
	u8 name[20];
} __packed;
} __packed;


struct clk_get_value {
	__le32 rate;
} __packed;

struct clk_set_value {
struct clk_set_value {
	__le16 id;
	__le16 id;
	__le16 reserved;
	__le16 reserved;
@@ -346,10 +342,6 @@ struct _scpi_sensor_info {
	char name[20];
	char name[20];
};
};


struct sensor_value {
	__le64 val;
};

struct dev_pstate_set {
struct dev_pstate_set {
	__le16 dev_id;
	__le16 dev_id;
	u8 pstate;
	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)
static unsigned long scpi_clk_get_val(u16 clk_id)
{
{
	int ret;
	int ret;
	struct clk_get_value clk;
	__le32 rate;
	__le16 le_clk_id = cpu_to_le16(clk_id);
	__le16 le_clk_id = cpu_to_le16(clk_id);


	ret = scpi_send_message(CMD_GET_CLOCK_VALUE, &le_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)
static 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)
static int scpi_sensor_get_value(u16 sensor, u64 *val)
static int scpi_sensor_get_value(u16 sensor, u64 *val)
{
{
	__le16 id = cpu_to_le16(sensor);
	__le16 id = cpu_to_le16(sensor);
	struct sensor_value buf;
	__le64 value;
	int ret;
	int ret;


	ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id),
	ret = scpi_send_message(CMD_SENSOR_VALUE, &id, sizeof(id),
				&buf, sizeof(buf));
				&value, sizeof(value));
	if (ret)
	if (ret)
		return ret;
		return ret;


	if (scpi_info->is_legacy)
	if (scpi_info->is_legacy)
		/* only 32-bits supported, upper 32 bits can be junk */
		/* only 32-bits supported, upper 32 bits can be junk */
		*val = le32_to_cpup((__le32 *)&buf.val);
		*val = le32_to_cpup((__le32 *)&value);
	else
	else
		*val = le64_to_cpu(buf.val);
		*val = le64_to_cpu(value);


	return 0;
	return 0;
}
}