hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/ptp/ptp_sysfs.c
....@@ -1,21 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * PTP 1588 clock support - sysfs interface.
34 *
45 * Copyright (C) 2010 OMICRON electronics GmbH
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
9
- * (at your option) any later version.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
196 */
207 #include <linux/capability.h>
218 #include <linux/slab.h>
....@@ -26,7 +13,7 @@
2613 struct device_attribute *attr, char *page)
2714 {
2815 struct ptp_clock *ptp = dev_get_drvdata(dev);
29
- return snprintf(page, PAGE_SIZE-1, "%s\n", ptp->info->name);
16
+ return sysfs_emit(page, "%s\n", ptp->info->name);
3017 }
3118 static DEVICE_ATTR_RO(clock_name);
3219
....@@ -240,7 +227,7 @@
240227
241228 mutex_unlock(&ptp->pincfg_mux);
242229
243
- return snprintf(page, PAGE_SIZE, "%u %u\n", func, chan);
230
+ return sysfs_emit(page, "%u %u\n", func, chan);
244231 }
245232
246233 static ssize_t ptp_pin_store(struct device *dev, struct device_attribute *attr,