regmap-debugfs.c (03ab8e6297acd1bc0eedaa050e2a1635c576fd11) regmap-debugfs.c (23baf831a32c04f9a968812511540b1b3e648bf5)
1// SPDX-License-Identifier: GPL-2.0
2//
3// Register map access API - debugfs
4//
5// Copyright 2011 Wolfson Microelectronics plc
6//
7// Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
8

--- 212 unchanged lines hidden (view full) ---

221 ssize_t ret;
222 int i;
223 char *buf;
224 unsigned int val, start_reg;
225
226 if (*ppos < 0 || !count)
227 return -EINVAL;
228
1// SPDX-License-Identifier: GPL-2.0
2//
3// Register map access API - debugfs
4//
5// Copyright 2011 Wolfson Microelectronics plc
6//
7// Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
8

--- 212 unchanged lines hidden (view full) ---

221 ssize_t ret;
222 int i;
223 char *buf;
224 unsigned int val, start_reg;
225
226 if (*ppos < 0 || !count)
227 return -EINVAL;
228
229 if (count > (PAGE_SIZE << (MAX_ORDER - 1)))
230 count = PAGE_SIZE << (MAX_ORDER - 1);
229 if (count > (PAGE_SIZE << MAX_ORDER))
230 count = PAGE_SIZE << MAX_ORDER;
231
232 buf = kmalloc(count, GFP_KERNEL);
233 if (!buf)
234 return -ENOMEM;
235
236 regmap_calc_tot_len(map, buf, count);
237
238 /* Work out which register we're starting at */

--- 129 unchanged lines hidden (view full) ---

368 char *buf;
369 char *entry;
370 int ret;
371 unsigned int entry_len;
372
373 if (*ppos < 0 || !count)
374 return -EINVAL;
375
231
232 buf = kmalloc(count, GFP_KERNEL);
233 if (!buf)
234 return -ENOMEM;
235
236 regmap_calc_tot_len(map, buf, count);
237
238 /* Work out which register we're starting at */

--- 129 unchanged lines hidden (view full) ---

368 char *buf;
369 char *entry;
370 int ret;
371 unsigned int entry_len;
372
373 if (*ppos < 0 || !count)
374 return -EINVAL;
375
376 if (count > (PAGE_SIZE << (MAX_ORDER - 1)))
377 count = PAGE_SIZE << (MAX_ORDER - 1);
376 if (count > (PAGE_SIZE << MAX_ORDER))
377 count = PAGE_SIZE << MAX_ORDER;
378
379 buf = kmalloc(count, GFP_KERNEL);
380 if (!buf)
381 return -ENOMEM;
382
383 entry = kmalloc(PAGE_SIZE, GFP_KERNEL);
384 if (!entry) {
385 kfree(buf);

--- 307 unchanged lines hidden ---
378
379 buf = kmalloc(count, GFP_KERNEL);
380 if (!buf)
381 return -ENOMEM;
382
383 entry = kmalloc(PAGE_SIZE, GFP_KERNEL);
384 if (!entry) {
385 kfree(buf);

--- 307 unchanged lines hidden ---