diff mbox

[4/7] thermal: rcar_gen3_thermal: record more information about each TSC

Message ID 20170306200401.29923-5-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State Superseded, archived
Delegated to: Eduardo Valentin
Headers show

Commit Message

Niklas Söderlund March 6, 2017, 8:03 p.m. UTC
The struct rcar_gen3_thermal_tsc benefits from knowing which TSC it
represent. Record this at probe time before this information is lost.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/thermal/rcar_gen3_thermal.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Geert Uytterhoeven March 7, 2017, 3:31 p.m. UTC | #1
On Mon, Mar 6, 2017 at 9:03 PM, Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The struct rcar_gen3_thermal_tsc benefits from knowing which TSC it
> represent. Record this at probe time before this information is lost.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Geert Uytterhoeven March 7, 2017, 3:41 p.m. UTC | #2
Hi Niklas,

On Mon, Mar 6, 2017 at 9:03 PM, Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The struct rcar_gen3_thermal_tsc benefits from knowing which TSC it
> represent. Record this at probe time before this information is lost.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/thermal/rcar_gen3_thermal.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
> index 5d4a5483eb13e796..65f7204936a18278 100644
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -68,6 +68,8 @@ struct equation_coefs {
>  };
>
>  struct rcar_gen3_thermal_tsc {
> +       struct device *dev;
> +       int num;

BTW, adding the "int" here will introduce a 4-byte gap on 64-bit platforms.
Note that it doesn't hurt much in this case, as the struct will be padded to a
multiple of 8 bytes anyway.

>         void __iomem *base;
>         struct thermal_zone_device *zone;
>         struct equation_coefs coef;

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Wolfram Sang March 7, 2017, 7:55 p.m. UTC | #3
On Mon, Mar 06, 2017 at 09:03:58PM +0100, Niklas Söderlund wrote:
> The struct rcar_gen3_thermal_tsc benefits from knowing which TSC it
> represent. Record this at probe time before this information is lost.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

See next review. I don't think this is needed.
diff mbox

Patch

diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index 5d4a5483eb13e796..65f7204936a18278 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -68,6 +68,8 @@  struct equation_coefs {
 };
 
 struct rcar_gen3_thermal_tsc {
+	struct device *dev;
+	int num;
 	void __iomem *base;
 	struct thermal_zone_device *zone;
 	struct equation_coefs coef;
@@ -282,6 +284,9 @@  static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 			goto error_unregister;
 		}
 
+		tsc->dev = dev;
+		tsc->num = i;
+
 		res = platform_get_resource(pdev, IORESOURCE_MEM, i);
 		if (!res) {
 			ret = -ENODEV;