lkml.org 
[lkml]   [2012]   [Mar]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 2/6] firmware_class: Split _request_firmware() into three functions
    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.



    \
     
     \ /
      Last update: 2012-03-26 20:23    [W:2.667 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site