lkml.org 
[lkml]   [2012]   [Apr]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 13/13] clk: basic: improve parent_names & return errors
    On Wed, Apr 11, 2012 at 06:02:51PM -0700, Mike Turquette wrote:
    > This patch is the basic clk version of 'clk: core: copy parent_names &
    > return error codes'.
    >
    > The registration functions are changed to allow the core code to copy
    > the array of strings and allow platforms to declare those arrays as
    > __initdata.
    >
    > This patch also converts all of the basic clk registration functions to
    > return error codes which better aligns them with the existing clk.h api.
    >
    >
    > + */
    > struct clk *clk_register_divider(struct device *dev, const char *name,
    > const char *parent_name, unsigned long flags,
    > void __iomem *reg, u8 shift, u8 width,
    > u8 clk_divider_flags, spinlock_t *lock)
    > {
    > struct clk_divider *div;
    > - struct clk *clk;
    > + struct clk *clk = ERR_PTR(-ENOMEM);
    > + const char *parent_names[1];
    >
    > + /* allocate the divider */
    > div = kzalloc(sizeof(struct clk_divider), GFP_KERNEL);
    > -
    > if (!div) {
    > pr_err("%s: could not allocate divider clk\n", __func__);
    > return NULL;

    You missed a conversion to ERR_PTR here.

    Sascha

    --
    Pengutronix e.K. | |
    Industrial Linux Solutions | http://www.pengutronix.de/ |
    Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
    Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |


    \
     
     \ /
      Last update: 2012-04-16 22:55    [W:4.203 / U:0.176 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site