| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Parisc performance counters |
|---|
| 3 | 4 | * Copyright (C) 2001 Randolph Chung <tausq@debian.org> |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * This code is derived, with permission, from HP/UX sources. |
|---|
| 6 | | - * |
|---|
| 7 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 9 | | - * the Free Software Foundation; either version 2, or (at your option) |
|---|
| 10 | | - * any later version. |
|---|
| 11 | | - * |
|---|
| 12 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 13 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | | - * GNU General Public License for more details. |
|---|
| 16 | | - * |
|---|
| 17 | | - * You should have received a copy of the GNU General Public License |
|---|
| 18 | | - * along with this program; if not, write to the Free Software |
|---|
| 19 | | - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 20 | 7 | */ |
|---|
| 21 | 8 | |
|---|
| 22 | 9 | /* |
|---|
| .. | .. |
|---|
| 313 | 300 | else |
|---|
| 314 | 301 | return -EFAULT; |
|---|
| 315 | 302 | |
|---|
| 316 | | - if (!capable(CAP_SYS_ADMIN)) |
|---|
| 303 | + if (!perfmon_capable()) |
|---|
| 317 | 304 | return -EACCES; |
|---|
| 318 | 305 | |
|---|
| 319 | 306 | if (count != sizeof(uint32_t)) |
|---|
| .. | .. |
|---|
| 805 | 792 | return -1; |
|---|
| 806 | 793 | } |
|---|
| 807 | 794 | |
|---|
| 808 | | - runway = ioremap_nocache(cpu_device->hpa.start, 4096); |
|---|
| 795 | + runway = ioremap(cpu_device->hpa.start, 4096); |
|---|
| 809 | 796 | if (!runway) { |
|---|
| 810 | 797 | pr_err("perf_write_image: ioremap failed!\n"); |
|---|
| 811 | 798 | return -ENOMEM; |
|---|