mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-21 22:47:56 +00:00
793f8ab62c
Add kernel patches for version 6.1. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
71 lines
2.5 KiB
Diff
71 lines
2.5 KiB
Diff
From cdb7a9e14810f5cd40abf9cd3959294ee9283069 Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Mon, 11 Jul 2022 15:58:36 +0200
|
|
Subject: [PATCH] clk: bcm: rpi: Create helper to retrieve private data
|
|
|
|
The RaspberryPi firmware clocks driver uses in several instances a
|
|
container_of to retrieve the struct raspberrypi_clk_data from a pointer
|
|
to struct clk_hw. Let's create a small function to avoid duplicating it
|
|
all over the place.
|
|
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
drivers/clk/bcm/clk-raspberrypi.c | 18 ++++++++++--------
|
|
1 file changed, 10 insertions(+), 8 deletions(-)
|
|
|
|
--- a/drivers/clk/bcm/clk-raspberrypi.c
|
|
+++ b/drivers/clk/bcm/clk-raspberrypi.c
|
|
@@ -75,6 +75,12 @@ struct raspberrypi_clk_data {
|
|
struct raspberrypi_clk *rpi;
|
|
};
|
|
|
|
+static inline
|
|
+const struct raspberrypi_clk_data *clk_hw_to_data(const struct clk_hw *hw)
|
|
+{
|
|
+ return container_of(hw, struct raspberrypi_clk_data, hw);
|
|
+}
|
|
+
|
|
struct raspberrypi_clk_variant {
|
|
bool export;
|
|
char *clkdev;
|
|
@@ -187,8 +193,7 @@ static int raspberrypi_clock_property(st
|
|
|
|
static int raspberrypi_fw_is_prepared(struct clk_hw *hw)
|
|
{
|
|
- struct raspberrypi_clk_data *data =
|
|
- container_of(hw, struct raspberrypi_clk_data, hw);
|
|
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
|
struct raspberrypi_clk *rpi = data->rpi;
|
|
u32 val = 0;
|
|
int ret;
|
|
@@ -205,8 +210,7 @@ static int raspberrypi_fw_is_prepared(st
|
|
static unsigned long raspberrypi_fw_get_rate(struct clk_hw *hw,
|
|
unsigned long parent_rate)
|
|
{
|
|
- struct raspberrypi_clk_data *data =
|
|
- container_of(hw, struct raspberrypi_clk_data, hw);
|
|
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
|
struct raspberrypi_clk *rpi = data->rpi;
|
|
u32 val = 0;
|
|
int ret;
|
|
@@ -222,8 +226,7 @@ static unsigned long raspberrypi_fw_get_
|
|
static int raspberrypi_fw_set_rate(struct clk_hw *hw, unsigned long rate,
|
|
unsigned long parent_rate)
|
|
{
|
|
- struct raspberrypi_clk_data *data =
|
|
- container_of(hw, struct raspberrypi_clk_data, hw);
|
|
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
|
struct raspberrypi_clk *rpi = data->rpi;
|
|
u32 _rate = rate;
|
|
int ret;
|
|
@@ -240,8 +243,7 @@ static int raspberrypi_fw_set_rate(struc
|
|
static int raspberrypi_fw_dumb_determine_rate(struct clk_hw *hw,
|
|
struct clk_rate_request *req)
|
|
{
|
|
- struct raspberrypi_clk_data *data =
|
|
- container_of(hw, struct raspberrypi_clk_data, hw);
|
|
+ const struct raspberrypi_clk_data *data = clk_hw_to_data(hw);
|
|
struct raspberrypi_clk_variant *variant = data->variant;
|
|
|
|
/*
|