From ee930fffee469d076998274a2ca55e13dc1efb67 Mon Sep 17 00:00:00 2001
From: hc <hc@nodka.com>
Date: Fri, 10 May 2024 08:50:54 +0000
Subject: [PATCH] enable tun/tap/iptables
---
kernel/drivers/power/supply/pcf50633-charger.c | 24 ++++++++----------------
1 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/kernel/drivers/power/supply/pcf50633-charger.c b/kernel/drivers/power/supply/pcf50633-charger.c
index 1aba140..8c5d892 100644
--- a/kernel/drivers/power/supply/pcf50633-charger.c
+++ b/kernel/drivers/power/supply/pcf50633-charger.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
/* NXP PCF50633 Main Battery Charger Driver
*
* (C) 2006-2008 by Openmoko, Inc.
@@ -6,12 +7,6 @@
*
* Broken down from monstrous PCF50633 driver mainly by
* Harald Welte, Andy Green and Werner Almesberger
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
*/
#include <linux/kernel.h>
@@ -245,17 +240,14 @@
*/
static DEVICE_ATTR(chg_curlim, S_IRUGO | S_IWUSR, show_chglim, set_chglim);
-static struct attribute *pcf50633_mbc_sysfs_entries[] = {
+static struct attribute *pcf50633_mbc_sysfs_attrs[] = {
&dev_attr_chgmode.attr,
&dev_attr_usb_curlim.attr,
&dev_attr_chg_curlim.attr,
NULL,
};
-static const struct attribute_group mbc_attr_group = {
- .name = NULL, /* put in device directory */
- .attrs = pcf50633_mbc_sysfs_entries,
-};
+ATTRIBUTE_GROUPS(pcf50633_mbc_sysfs);
static void
pcf50633_mbc_irq_handler(int irq, void *data)
@@ -390,6 +382,7 @@
static int pcf50633_mbc_probe(struct platform_device *pdev)
{
struct power_supply_config psy_cfg = {};
+ struct power_supply_config usb_psy_cfg;
struct pcf50633_mbc *mbc;
int i;
u8 mbcs1;
@@ -419,8 +412,11 @@
return PTR_ERR(mbc->adapter);
}
+ usb_psy_cfg = psy_cfg;
+ usb_psy_cfg.attr_grp = pcf50633_mbc_sysfs_groups;
+
mbc->usb = power_supply_register(&pdev->dev, &pcf50633_mbc_usb_desc,
- &psy_cfg);
+ &usb_psy_cfg);
if (IS_ERR(mbc->usb)) {
dev_err(mbc->pcf->dev, "failed to register usb\n");
power_supply_unregister(mbc->adapter);
@@ -435,9 +431,6 @@
power_supply_unregister(mbc->usb);
return PTR_ERR(mbc->ac);
}
-
- if (sysfs_create_group(&pdev->dev.kobj, &mbc_attr_group))
- dev_err(mbc->pcf->dev, "failed to create sysfs entries\n");
mbcs1 = pcf50633_reg_read(mbc->pcf, PCF50633_REG_MBCS1);
if (mbcs1 & PCF50633_MBCS1_USBPRES)
@@ -457,7 +450,6 @@
for (i = 0; i < ARRAY_SIZE(mbc_irq_handlers); i++)
pcf50633_free_irq(mbc->pcf, mbc_irq_handlers[i]);
- sysfs_remove_group(&pdev->dev.kobj, &mbc_attr_group);
power_supply_unregister(mbc->usb);
power_supply_unregister(mbc->adapter);
power_supply_unregister(mbc->ac);
--
Gitblit v1.6.2