hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/media/i2c/s5c73m3/s5c73m3-core.c
....@@ -1,18 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Samsung LSI S5C73M3 8M pixel camera driver
34 *
45 * Copyright (C) 2012, Samsung Electronics, Co., Ltd.
56 * Sylwester Nawrocki <s.nawrocki@samsung.com>
67 * Andrzej Hajda <a.hajda@samsung.com>
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * version 2 as published by the Free Software Foundation.
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.
168 */
179
1810 #include <linux/clk.h>
....@@ -1431,7 +1423,7 @@
14311423 for (++i; i < S5C73M3_MAX_SUPPLIES; i++) {
14321424 int r = regulator_enable(state->supplies[i].consumer);
14331425 if (r < 0)
1434
- v4l2_err(&state->oif_sd, "Failed to reenable %s: %d\n",
1426
+ v4l2_err(&state->oif_sd, "Failed to re-enable %s: %d\n",
14351427 state->supplies[i].supply, r);
14361428 }
14371429
....@@ -1603,7 +1595,7 @@
16031595 const struct s5c73m3_platform_data *pdata = dev->platform_data;
16041596 struct device_node *node = dev->of_node;
16051597 struct device_node *node_ep;
1606
- struct v4l2_fwnode_endpoint ep;
1598
+ struct v4l2_fwnode_endpoint ep = { .bus_type = 0 };
16071599 int ret;
16081600
16091601 if (!node) {
....@@ -1644,7 +1636,7 @@
16441636 if (ret)
16451637 return ret;
16461638
1647
- if (ep.bus_type != V4L2_MBUS_CSI2) {
1639
+ if (ep.bus_type != V4L2_MBUS_CSI2_DPHY) {
16481640 dev_err(dev, "unsupported bus type\n");
16491641 return -EINVAL;
16501642 }
....@@ -1658,8 +1650,7 @@
16581650 return 0;
16591651 }
16601652
1661
-static int s5c73m3_probe(struct i2c_client *client,
1662
- const struct i2c_device_id *id)
1653
+static int s5c73m3_probe(struct i2c_client *client)
16631654 {
16641655 struct device *dev = &client->dev;
16651656 struct v4l2_subdev *sd;
....@@ -1683,7 +1674,7 @@
16831674 v4l2_subdev_init(sd, &s5c73m3_subdev_ops);
16841675 sd->owner = client->dev.driver->owner;
16851676 v4l2_set_subdevdata(sd, state);
1686
- strlcpy(sd->name, "S5C73M3", sizeof(sd->name));
1677
+ strscpy(sd->name, "S5C73M3", sizeof(sd->name));
16871678
16881679 sd->internal_ops = &s5c73m3_internal_ops;
16891680 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
....@@ -1698,7 +1689,8 @@
16981689 return ret;
16991690
17001691 v4l2_i2c_subdev_init(oif_sd, client, &oif_subdev_ops);
1701
- strcpy(oif_sd->name, "S5C73M3-OIF");
1692
+ /* Static name; NEVER use in new drivers! */
1693
+ strscpy(oif_sd->name, "S5C73M3-OIF", sizeof(oif_sd->name));
17021694
17031695 oif_sd->internal_ops = &oif_internal_ops;
17041696 oif_sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
....@@ -1813,7 +1805,7 @@
18131805 .of_match_table = of_match_ptr(s5c73m3_of_match),
18141806 .name = DRIVER_NAME,
18151807 },
1816
- .probe = s5c73m3_probe,
1808
+ .probe_new = s5c73m3_probe,
18171809 .remove = s5c73m3_remove,
18181810 .id_table = s5c73m3_id,
18191811 };