Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1237845
| From | Stephen Boyd <sboyd@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/3] clk: bcm2835: Add a driver for the auxiliary peripheral clock gates. |
| Date | 2015-10-02 02:20 +0200 |
| Message-ID | <qeWeS-3IM-5@gated-at.bofh.it> (permalink) |
| References | <q7ivU-6Gg-13@gated-at.bofh.it> <q7ivU-6Gg-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 09/10, Eric Anholt wrote:
> diff --git a/drivers/clk/bcm/clk-bcm2835-aux.c b/drivers/clk/bcm/clk-bcm2835-aux.c
> new file mode 100644
> index 0000000..1efa6fb
> --- /dev/null
> +++ b/drivers/clk/bcm/clk-bcm2835-aux.c
> @@ -0,0 +1,80 @@
> +/*
> + * Copyright (C) 2015 Broadcom
> + *
> + * 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.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + */
> +
> +#include <linux/clk-provider.h>
> +#include <linux/clkdev.h>
Is this include used?
> +#include <linux/clk/bcm2835.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <dt-bindings/clock/bcm2835-aux.h>
> +
> +static int bcm2835_aux_clk_probe(struct platform_device *pdev)
> +{
> + struct device *dev = &pdev->dev;
> + struct clk_onecell_data *onecell;
> + const char *parent;
> + struct clk *parent_clk;
> + void __iomem *reg;
> +
> + parent_clk = of_clk_get(dev->of_node, 0);
> + if (IS_ERR(parent_clk))
> + return PTR_ERR(parent_clk);
We have a device, any reason we can't use clk_get() directly?
> + parent = __clk_get_name(parent_clk);
> +
> + reg = of_iomap(dev->of_node, 0);
We have a platform device here, why aren't we using platform
device APIs like platform_get_resource() and
devm_ioremap_resource()?
> + if (!reg)
> + return -ENODEV;
> +
> + onecell = kmalloc(sizeof(*onecell), GFP_KERNEL);
> + if (!onecell)
> + return -ENOMEM;
> + onecell->clk_num = BCM2835_AUX_CLOCK_COUNT;
> + onecell->clks = kzalloc(sizeof(*onecell->clks) *
kcalloc?
> + BCM2835_AUX_CLOCK_COUNT, GFP_KERNEL);
> + if (!onecell->clks)
> + return -ENOMEM;
> +
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 2/3] clk: bcm2835: Add a driver for the auxiliary peripheral clock gates. Stephen Boyd <sboyd@codeaurora.org> - 2015-10-02 02:20 +0200
csiph-web