Skip to content

Commit 618c1ea

Browse files
committed
Merge branch 'pci/pwrctrl'
- Add optional slot clock for cases where the PCIe host controller and the slot are supplied by different clocks (Marek Vasut) - Fix kerneldoc tag for private fields (Bartosz Golaszewski) * pci/pwrctrl: PCI/pwrctrl: Fix the kerneldoc tag for private fields PCI/pwrctrl: Add optional slot clock for PCI slots
2 parents 9fef768 + 3aa54d1 commit 618c1ea

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/pci/pwrctrl/slot.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Author: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
55
*/
66

7+
#include <linux/clk.h>
78
#include <linux/device.h>
89
#include <linux/mod_devicetable.h>
910
#include <linux/module.h>
@@ -30,6 +31,7 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
3031
{
3132
struct pci_pwrctrl_slot_data *slot;
3233
struct device *dev = &pdev->dev;
34+
struct clk *clk;
3335
int ret;
3436

3537
slot = devm_kzalloc(dev, sizeof(*slot), GFP_KERNEL);
@@ -55,6 +57,12 @@ static int pci_pwrctrl_slot_probe(struct platform_device *pdev)
5557
if (ret)
5658
goto err_regulator_disable;
5759

60+
clk = devm_clk_get_optional_enabled(dev, NULL);
61+
if (IS_ERR(clk)) {
62+
return dev_err_probe(dev, PTR_ERR(clk),
63+
"Failed to enable slot clock\n");
64+
}
65+
5866
pci_pwrctrl_init(&slot->ctx, dev);
5967

6068
ret = devm_pci_pwrctrl_device_set_ready(dev, &slot->ctx);

include/linux/pci-pwrctrl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ struct device_link;
3939
struct pci_pwrctrl {
4040
struct device *dev;
4141

42-
/* Private: don't use. */
42+
/* private: internal use only */
4343
struct notifier_block nb;
4444
struct device_link *link;
4545
struct work_struct work;

0 commit comments

Comments
 (0)