]> git.sur5r.net Git - u-boot/blobdiff - drivers/clk/clk-uclass.c
spi: mxc: Fix compilation problem of DM_SPI class driver
[u-boot] / drivers / clk / clk-uclass.c
index 6e99b3b15df5f444ce97300cb1931df54cc15ab1..419d4515acc6c240299d75572ffdab8af3cf0656 100644 (file)
@@ -1,10 +1,9 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2015 Google, Inc
  * Written by Simon Glass <sjg@chromium.org>
  * Copyright (c) 2016, NVIDIA CORPORATION.
  * Copyright (c) 2018, Theobroma Systems Design und Consulting GmbH
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -111,8 +110,8 @@ int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk)
        bulk->count = 0;
 
        count = dev_count_phandle_with_args(dev, "clocks", "#clock-cells");
-       if (!count)
-               return 0;
+       if (count < 1)
+               return count;
 
        bulk->clks = devm_kcalloc(dev, count, sizeof(struct clk), GFP_KERNEL);
        if (!bulk->clks)