clk-clps711x.c (0cce284537fb42d9c28b9b31038ffc9b464555f5) | clk-clps711x.c (acafe7e30216166a17e6e226aadc3ecb63993242) |
---|---|
1/* 2 * Cirrus Logic CLPS711X CLK driver 3 * 4 * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 40 unchanged lines hidden (view full) --- 49{ 50 u32 tmp, f_cpu, f_pll, f_bus, f_tim, f_pwm, f_spi; 51 struct clps711x_clk *clps711x_clk; 52 unsigned i; 53 54 if (!base) 55 return ERR_PTR(-ENOMEM); 56 | 1/* 2 * Cirrus Logic CLPS711X CLK driver 3 * 4 * Copyright (C) 2014 Alexander Shiyan <shc_work@mail.ru> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or --- 40 unchanged lines hidden (view full) --- 49{ 50 u32 tmp, f_cpu, f_pll, f_bus, f_tim, f_pwm, f_spi; 51 struct clps711x_clk *clps711x_clk; 52 unsigned i; 53 54 if (!base) 55 return ERR_PTR(-ENOMEM); 56 |
57 clps711x_clk = kzalloc(sizeof(*clps711x_clk) + 58 sizeof(*clps711x_clk->clk_data.hws) * CLPS711X_CLK_MAX, 59 GFP_KERNEL); | 57 clps711x_clk = kzalloc(struct_size(clps711x_clk, clk_data.hws, 58 CLPS711X_CLK_MAX), 59 GFP_KERNEL); |
60 if (!clps711x_clk) 61 return ERR_PTR(-ENOMEM); 62 63 spin_lock_init(&clps711x_clk->lock); 64 65 /* Read PLL multiplier value and sanity check */ 66 tmp = readl(base + CLPS711X_PLLR) >> 24; 67 if (((tmp >= 10) && (tmp <= 50)) || !fref) --- 121 unchanged lines hidden --- | 60 if (!clps711x_clk) 61 return ERR_PTR(-ENOMEM); 62 63 spin_lock_init(&clps711x_clk->lock); 64 65 /* Read PLL multiplier value and sanity check */ 66 tmp = readl(base + CLPS711X_PLLR) >> 24; 67 if (((tmp >= 10) && (tmp <= 50)) || !fref) --- 121 unchanged lines hidden --- |