Re: [PATCH 2/6] firmware_class: Split _request_firmware() into threefunctions

From: Stephen Boyd
Date: Mon Mar 26 2012 - 14:21:37 EST


On 03/26/12 11:15, Stephen Boyd wrote:
> On 03/25/12 15:01, Rafael J. Wysocki wrote:
>> drivers/base/firmware_class.c | 57 +++++++++++++++++++++++++++++-------------
>> 1 file changed, 40 insertions(+), 17 deletions(-)
>>
>> Index: linux/drivers/base/firmware_class.c
>> ===================================================================
>> --- linux.orig/drivers/base/firmware_class.c
>> +++ linux/drivers/base/firmware_class.c
>> @@ -435,7 +435,7 @@ static void firmware_class_timeout(u_lon
>> }
>>
>> static struct firmware_priv *
>> -fw_create_instance(struct firmware *firmware, const char *fw_name,
>> +fw_create_instance(const struct firmware *firmware, const char *fw_name,
>> struct device *device, bool uevent, bool nowait)
>> {
>> struct firmware_priv *fw_priv;
>> @@ -449,7 +449,7 @@ fw_create_instance(struct firmware *firm
>> goto err_out;
>> }
>>
>> - fw_priv->fw = firmware;
>> + fw_priv->fw = (struct firmware *)firmware;
>> fw_priv->nowait = nowait;
>> strcpy(fw_priv->fw_id, fw_name);
>> init_completion(&fw_priv->completion);
> Can we avoid this cast? If we do some parts of fw_create_instance()
> during the setup phase I think we can avoid it.
>

Oops. With the other patch you can squash this in to do what I
originally talked about.

-----8<-----
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index fbe98a8..113d37d 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -435,7 +435,7 @@ static void firmware_class_timeout(u_long data)
}

static struct firmware_priv *
-fw_create_instance(const struct firmware *firmware, const char *fw_name,
+fw_create_instance(struct firmware *firmware, const char *fw_name,
struct device *device, bool uevent, bool nowait)
{
struct firmware_priv *fw_priv;
@@ -447,7 +447,7 @@ fw_create_instance(const struct firmware *firmware, const char *fw_name,
return ERR_PTR(-ENOMEM);
}

- fw_priv->fw = (struct firmware *)firmware;
+ fw_priv->fw = firmware;
fw_priv->nowait = nowait;
strcpy(fw_priv->fw_id, fw_name);
init_completion(&fw_priv->completion);


--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/