phy: qcom-qmp-pcie: drop redundant clock allocation
authorJohan Hovold <johan+linaro@kernel.org>
Fri, 11 Nov 2022 09:42:39 +0000 (10:42 +0100)
committerVinod Koul <vkoul@kernel.org>
Thu, 24 Nov 2022 17:25:17 +0000 (22:55 +0530)
Since the QMP driver split, there is no reason to allocate the
fixed-rate pipe clock structure separately from the driver data.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20221111094239.11547-4-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c

index 53dde20..1b136a8 100644 (file)
@@ -1550,6 +1550,8 @@ struct qmp_pcie {
 
        struct phy *phy;
        int mode;
+
+       struct clk_fixed_rate pipe_clk_fixed;
 };
 
 static inline void qphy_setbits(void __iomem *base, u32 offset, u32 val)
@@ -2416,7 +2418,7 @@ static void phy_clk_release_provider(void *res)
  */
 static int phy_pipe_clk_register(struct qmp_pcie *qmp, struct device_node *np)
 {
-       struct clk_fixed_rate *fixed;
+       struct clk_fixed_rate *fixed = &qmp->pipe_clk_fixed;
        struct clk_init_data init = { };
        int ret;
 
@@ -2426,10 +2428,6 @@ static int phy_pipe_clk_register(struct qmp_pcie *qmp, struct device_node *np)
                return ret;
        }
 
-       fixed = devm_kzalloc(qmp->dev, sizeof(*fixed), GFP_KERNEL);
-       if (!fixed)
-               return -ENOMEM;
-
        init.ops = &clk_fixed_rate_ops;
 
        /*