Skip to content

Commit a1a10cd

Browse files
committed
Merge tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk driver fixes from Stephen Boyd: - Mark the DDR bus clk critical in the SpaceMiT driver so that boot doesn't fail - Fix boot on Mobile EyeQ by creating the auxiliary device for the ethernet PHY - Plug an OF node leak in Rockchip rk808 clk driver * tag 'clk-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: clk: rk808: fix OF node reference imbalance MAINTAINERS: add myself as a reviewer for the clk subsystem reset: eyeq: drop device_set_of_node_from_dev() done by parent clk: eyeq: add EyeQ5 children auxiliary device for generic PHYs clk: eyeq: use the auxiliary device creation helper clk: spacemit: k3: mark top_dclk as CLK_IS_CRITICAL
2 parents 515186b + de019f2 commit a1a10cd

5 files changed

Lines changed: 20 additions & 69 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6356,6 +6356,7 @@ F: include/uapi/linux/comedi.h
63566356
COMMON CLK FRAMEWORK
63576357
M: Michael Turquette <mturquette@baylibre.com>
63586358
M: Stephen Boyd <sboyd@kernel.org>
6359+
R: Brian Masney <bmasney@redhat.com>
63596360
L: linux-clk@vger.kernel.org
63606361
S: Maintained
63616362
Q: http://patchwork.kernel.org/project/linux-clk/list/

drivers/clk/clk-eyeq.c

Lines changed: 15 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ struct eqc_match_data {
110110

111111
const char *reset_auxdev_name;
112112
const char *pinctrl_auxdev_name;
113+
const char *eth_phy_auxdev_name;
113114

114115
unsigned int early_clk_count;
115116
};
@@ -321,38 +322,18 @@ static void eqc_probe_init_fixed_factors(struct device *dev,
321322
}
322323
}
323324

324-
static void eqc_auxdev_release(struct device *dev)
325-
{
326-
struct auxiliary_device *adev = to_auxiliary_dev(dev);
327-
328-
kfree(adev);
329-
}
330-
331-
static int eqc_auxdev_create(struct device *dev, void __iomem *base,
332-
const char *name, u32 id)
325+
static void eqc_auxdev_create_optional(struct device *dev, void __iomem *base,
326+
const char *name)
333327
{
334328
struct auxiliary_device *adev;
335-
int ret;
336-
337-
adev = kzalloc_obj(*adev);
338-
if (!adev)
339-
return -ENOMEM;
340-
341-
adev->name = name;
342-
adev->dev.parent = dev;
343-
adev->dev.platform_data = (void __force *)base;
344-
adev->dev.release = eqc_auxdev_release;
345-
adev->id = id;
346329

347-
ret = auxiliary_device_init(adev);
348-
if (ret)
349-
return ret;
350-
351-
ret = auxiliary_device_add(adev);
352-
if (ret)
353-
auxiliary_device_uninit(adev);
354-
355-
return ret;
330+
if (name) {
331+
adev = devm_auxiliary_device_create(dev, name,
332+
(void __force *)base);
333+
if (!adev)
334+
dev_warn(dev, "failed creating auxiliary device %s.%s\n",
335+
KBUILD_MODNAME, name);
336+
}
356337
}
357338

358339
static int eqc_probe(struct platform_device *pdev)
@@ -364,7 +345,6 @@ static int eqc_probe(struct platform_device *pdev)
364345
unsigned int i, clk_count;
365346
struct resource *res;
366347
void __iomem *base;
367-
int ret;
368348

369349
data = device_get_match_data(dev);
370350
if (!data)
@@ -378,21 +358,10 @@ static int eqc_probe(struct platform_device *pdev)
378358
if (!base)
379359
return -ENOMEM;
380360

381-
/* Init optional reset auxiliary device. */
382-
if (data->reset_auxdev_name) {
383-
ret = eqc_auxdev_create(dev, base, data->reset_auxdev_name, 0);
384-
if (ret)
385-
dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n",
386-
KBUILD_MODNAME, data->reset_auxdev_name, ret);
387-
}
388-
389-
/* Init optional pinctrl auxiliary device. */
390-
if (data->pinctrl_auxdev_name) {
391-
ret = eqc_auxdev_create(dev, base, data->pinctrl_auxdev_name, 0);
392-
if (ret)
393-
dev_warn(dev, "failed creating auxiliary device %s.%s: %d\n",
394-
KBUILD_MODNAME, data->pinctrl_auxdev_name, ret);
395-
}
361+
/* Init optional auxiliary devices. */
362+
eqc_auxdev_create_optional(dev, base, data->reset_auxdev_name);
363+
eqc_auxdev_create_optional(dev, base, data->pinctrl_auxdev_name);
364+
eqc_auxdev_create_optional(dev, base, data->eth_phy_auxdev_name);
396365

397366
if (data->pll_count + data->div_count + data->fixed_factor_count == 0)
398367
return 0; /* Zero clocks, we are done. */
@@ -553,6 +522,7 @@ static const struct eqc_match_data eqc_eyeq5_match_data = {
553522

554523
.reset_auxdev_name = "reset",
555524
.pinctrl_auxdev_name = "pinctrl",
525+
.eth_phy_auxdev_name = "phy",
556526

557527
.early_clk_count = ARRAY_SIZE(eqc_eyeq5_early_plls) +
558528
ARRAY_SIZE(eqc_eyeq5_early_fixed_factors),

drivers/clk/clk-rk808.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ static int rk808_clkout_probe(struct platform_device *pdev)
153153
struct rk808_clkout *rk808_clkout;
154154
int ret;
155155

156-
dev->of_node = pdev->dev.parent->of_node;
156+
device_set_of_node_from_dev(dev, dev->parent);
157157

158158
rk808_clkout = devm_kzalloc(dev,
159159
sizeof(*rk808_clkout), GFP_KERNEL);

drivers/clk/spacemit/ccu-k3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ static const struct clk_parent_data top_parents[] = {
846846
CCU_PARENT_HW(pll6_d3),
847847
};
848848
CCU_MUX_DIV_GATE_FC_DEFINE(top_dclk, top_parents, APMU_TOP_DCLK_CTRL, 5, 3,
849-
BIT(8), 2, 3, BIT(1), 0);
849+
BIT(8), 2, 3, BIT(1), CLK_IS_CRITICAL);
850850

851851
static const struct clk_parent_data ucie_parents[] = {
852852
CCU_PARENT_HW(pll1_d8_307p2),

drivers/reset/reset-eyeq.c

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -422,13 +422,6 @@ static int eqr_of_xlate_twocells(struct reset_controller_dev *rcdev,
422422
return eqr_of_xlate_internal(rcdev, reset_spec->args[0], reset_spec->args[1]);
423423
}
424424

425-
static void eqr_of_node_put(void *_dev)
426-
{
427-
struct device *dev = _dev;
428-
429-
of_node_put(dev->of_node);
430-
}
431-
432425
static int eqr_probe(struct auxiliary_device *adev,
433426
const struct auxiliary_device_id *id)
434427
{
@@ -439,21 +432,8 @@ static int eqr_probe(struct auxiliary_device *adev,
439432
int ret;
440433

441434
/*
442-
* We are an auxiliary device of clk-eyeq. We do not have an OF node by
443-
* default; let's reuse our parent's OF node.
444-
*/
445-
WARN_ON(dev->of_node);
446-
device_set_of_node_from_dev(dev, dev->parent);
447-
if (!dev->of_node)
448-
return -ENODEV;
449-
450-
ret = devm_add_action_or_reset(dev, eqr_of_node_put, dev);
451-
if (ret)
452-
return ret;
453-
454-
/*
455-
* Using our newfound OF node, we can get match data. We cannot use
456-
* device_get_match_data() because it does not match reused OF nodes.
435+
* Get match data. We cannot use device_get_match_data() because it does
436+
* not accept reused OF nodes; see device_set_of_node_from_dev().
457437
*/
458438
match = of_match_node(dev->driver->of_match_table, dev->of_node);
459439
if (!match || !match->data)

0 commit comments

Comments
 (0)