| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0 |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * System Control and Power Interface(SCPI) based hwmon sensor driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2015 ARM Ltd. |
|---|
| 5 | 6 | * Punit Agrawal <punit.agrawal@arm.com> |
|---|
| 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 version 2 as |
|---|
| 9 | | - * published by the Free Software Foundation. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed "as is" WITHOUT ANY WARRANTY of any |
|---|
| 12 | | - * kind, whether express or implied; without even the implied warranty |
|---|
| 13 | | - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | 7 | */ |
|---|
| 16 | 8 | |
|---|
| 17 | 9 | #include <linux/hwmon.h> |
|---|
| .. | .. |
|---|
| 235 | 227 | |
|---|
| 236 | 228 | sensor->scale = scale[sensor->info.class]; |
|---|
| 237 | 229 | |
|---|
| 238 | | - sensor->dev_attr_input.attr.mode = S_IRUGO; |
|---|
| 230 | + sensor->dev_attr_input.attr.mode = 0444; |
|---|
| 239 | 231 | sensor->dev_attr_input.show = scpi_show_sensor; |
|---|
| 240 | 232 | sensor->dev_attr_input.attr.name = sensor->input; |
|---|
| 241 | 233 | |
|---|
| 242 | | - sensor->dev_attr_label.attr.mode = S_IRUGO; |
|---|
| 234 | + sensor->dev_attr_label.attr.mode = 0444; |
|---|
| 243 | 235 | sensor->dev_attr_label.show = scpi_show_label; |
|---|
| 244 | 236 | sensor->dev_attr_label.attr.name = sensor->label; |
|---|
| 245 | 237 | |
|---|
| .. | .. |
|---|
| 295 | 287 | * any thermal zones or if the thermal subsystem is |
|---|
| 296 | 288 | * not configured. |
|---|
| 297 | 289 | */ |
|---|
| 298 | | - if (IS_ERR(z)) { |
|---|
| 290 | + if (IS_ERR(z)) |
|---|
| 299 | 291 | devm_kfree(dev, zone); |
|---|
| 300 | | - continue; |
|---|
| 301 | | - } |
|---|
| 302 | 292 | } |
|---|
| 303 | 293 | |
|---|
| 304 | 294 | return 0; |
|---|