summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'for-next/remoteproc' into masterSascha Hauer2020-10-142-54/+202
|\ \
| * | clk: i.MX8MQ: Add Cortex-M4 clkSascha Hauer2020-10-071-0/+5
| | | | | | | | | | | | | | | | | | Needed for the remoteproc driver on this SoC. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | remoteproc: imx: Add i.MX8M supportSascha Hauer2020-10-071-0/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support for the different i.MX8M SoCs to the i.MX rproc driver. i.MX8MM and i.MX8MQ can be handled like the i.MX7D with a different address space map. i.MX8MN and i.MX8MP are different though. Unlike the other SoCs which have a Cortex-M4 Coprocessor these have a Cortex-M7 Coprocessor. On these SoCs the TCM is only accessible when the Coprocessor is already started. A bit in the IOMUX GPR register space is needed to hold the CPU in wait mode until we uploaded the code to the TCM. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | remoteproc: imx: use function hooks in SoC dataSascha Hauer2020-10-071-31/+48
| | | | | | | | | | | | | | | | | | | | | | | | Replace the register offset/masks/values in driver data with function hooks to prepare the driver for adding SoCs that do not fit into this one-register-write scheme. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | remoteproc: imx: Change SoC order in codeSascha Hauer2020-10-071-29/+29
| | | | | | | | | | | | | | | | | | | | | Sort the SoC specific functions alphabetically to have a more natural order before adding more SoCs to the driver. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | remoteproc: imx: Fix off-by-one errorSascha Hauer2020-10-071-1/+1
| |/ | | | | | | | | | | | | size is actually end - start + 1, fix size passed to request_sdram_region(). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/reboot-mode' into masterSascha Hauer2020-10-148-0/+385
|\ \
| * \ Merge branch 'for-next/magicvar-unique-id' into for-next/reboot-modeSascha Hauer2020-10-073-21/+14
| |\ \
| * | | power: reset: syscon-reboot-mode: support multi-word reboot modesAhmad Fatoum2020-09-291-26/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SoCs like the i.MX6 have their BootROM consult two distinct 32-bit registers to determine the reboot mode. Extend the driver to support this. While backwards compatible, this is not so far supported by the upstream binding, which is why a new barebox,syscon-reboot-mode is introduced. This new compatible be inhibit used to inhibit fixup into a kernel device tree. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | power: reset: reboot-mode: support multi-word magicAhmad Fatoum2020-09-292-19/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The upstream binding and driver implementation only supports reboot modes of 32-bit length. This is insufficient for cases where multiple registers need to be written for the reboot mode to become active. The i.MX6 is an example for this, the BootROM expects a second 32-bit register to indicate whether the reboot mode in the first is valid. In preparation for adding support for this to the syscon-reboot-mode driver. Migrate the reboot-mode core to support this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | power: reset: reboot-mode: fix up node into boot device treeAhmad Fatoum2020-09-291-0/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of relying that the kernel and barebox device trees are in sync, just enforce it by having barebox fix up the device tree node it probed into the kernel device tree. We usually want that, but some reboot mode drivers might want to inhibit the fixup, e.g. because they implement a non-upstream binding or because they communicate with the BootROM, while the kernel shouldn't. For those the fixup is made optional via a struct reboot_mode_driver::no_fixup member. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | power: reset: reboot-mode: port syscon-reboot-mode supportAhmad Fatoum2020-09-293-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reboot modes are one-shot information that should be valid for only a single reset. Syscons that survive a warm reset are one way to implement this. This is used by many BootROMs to allow falling into a recovery mode on the next boot. This ports the Linux syscon-reboot-mode support. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | drivers: add reboot-mode infrastructureAhmad Fatoum2020-09-297-0/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reboot modes provide a well-defined way to exchange information between different stage of the boot process. When configured, users can type `reboot bootloader` in the OS and barebox can read it out a device parameter. Likewise barebox can write a reboot mode for the BootROM to evaluate and then reset to fall into a serial recovery mode for example. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/percent_pe' into masterSascha Hauer2020-10-148-18/+14
|\ \ \ \
| * | | | treewide: replace strerror(-PTR_ERR(errno)) with %pe format specifierAhmad Fatoum2020-09-293-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using %pe instead of PTR_ERR has the benefit of being less verbose and less error-prone (no negation necessary) while potentially reducing code size. Make use of it. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | vsprintf: retire strerrorp in favor of %peAhmad Fatoum2020-09-295-9/+8
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strerrorp() is only used along with printf. We now have a format specifier for printing error pointers directly, so use that and remove strerrorp. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/misc' into masterSascha Hauer2020-10-1411-18/+432
|\ \ \ \
| * | | | usb: dwc2: Uninitialize host and device on removeJules Maselbas2020-10-094-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device gadget must be properly uninitialized on poweroff however host system might not detect barebox's usb gadget has beeing disconnected. Signed-off-by: Jules Maselbas <jmaselbas@kalray.eu> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | of: implement of_property_write_strings for multiple stringsAhmad Fatoum2020-10-021-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current way to set a property with multiple values (e.g. compatible strings) is to have char properties[] = "st,stm32mp157c-dk2\0st,stm32mp157"; of_set_property(np, "compatible", properties, sizeof(properties), 1); Add a new helper to make this easier at the cost of one runtime reallocation: of_property_write_strings(np, "compatible, "st,stm32mp157c-dk2", "st,stm32mp157", NULL); Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | aiodev: am335x_adc: Driver for ADC on TI AM335x SoCsTrent Piepho2020-09-294-0/+355
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a simple driver for the ADC. It's designed to get single readings. Possible uses would be temperature sensing a thermistor, measuring a power rail, or a detecting multi-level board ID pin strapping. It's not designed to co-exist with a touch screen controller driver, which uses the same hardware on the AM335x, as there is no barebox touchscreen driver. The device tree binding is compatible with the Linux IIO driver. This is from the Linux driver: The ADC clock is expected to run at target of 3MHz, and expected to capture 12-bit data at a rate of 200 KSPS. The TSC_ADC_SS controller design assumes the OCP clock is at least 6x faster than the ADC clock. The OCP clock is 100 MHz, from CORE_CLKOUTM4/2. The AM335x Reference Manual §12.2.2 gives a max ADC clock of 24 MHz. There's nothing about the factor of 6x OCP to ADC, a 3 MHz ADC target, nor 200 kSPS. In §12.3.7 a limit of at least 15 ADC clock cycles per sample is given. The AM335x Datasheet §5.10 provides more parameters for the ADC: An ADC clock max of 3 MHz, a nominal conversion time of 13 cycles, min and max acquisition time of 2 to 257 cycles, and a max sample rate (@ 3 MHz) of 200 kSPS. A 3 MHz ADC clock at 15 cycles per sample provides for a 200 kSPS sampling rate. The minimum open, sampling, and conversion times are 0, 1, and 13 clocks, respectively. This would seem to indicate the sampling at 14 cyles per sample is possible. Perhaps the "Sample Delay" in the reference manual is called "Acquisition Time" in the datasheet, and the reference manual minimum of 1 cycle is incorrect and the minimum is actually 2 cycles. Which would then produce a minimum of 15 cycles per sample. This driver assumes the external references will be used (as does the Linux IIO driver). This would have been good to put into the device tree bindings, but the Linux driver's bindings did not do that. The Barebox driver will convert the ADC reading to mV, and assumes the external refs are GND and 1.8V. This also would have been nice to put into the device tree binding. It also doesn't allow for automatically adjusting for an external divider, commonly to measure power rails above 1.8V, e.g. the BeagleBone Black ain7 measures the 3.3V rail divided by 2. Signed-off-by: Trent Piepho <trent.piepho@synapse.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | aiodev: Name channels with device instance nameTrent Piepho2020-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dynamically assigning device names, an aiodev's name will be "aiodev" and an index, not part of the name string itself, will be allocated dynamically. These are combined to register a device with a name like "aiodev0" or "aiodev1". The shell environment variables use the device name, so one might use "${aiodev0.in_value0_mV}" and "${aiodev1.in_value0_mV}". However, the channel names that are used with aiochannel_get_by_name() just use the aiodev's name and channel name. So channel 0 of the 1st aiodev would be "aiodev.in_value0_mV" and the 2nd aiodev would use the same name. Change the channel naming to use the device instance name, e.g. "aiodev0", rather than the aiodev's base name. This makes the names used aiochannel_get_by_name() match the environment variable names and also avoids duplicate names with more than one dynamically allocated aiodev. Rename aiochannel_get_by_name() to aiochannel_by_name() so that any out of tree boards that use it will fail to compile, since they now need to pass in a different name. Signed-off-by: Trent Piepho <trent.piepho@synapse.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | | USB: musb: host: fix mismatched format specifier in dev_dbg()Ahmad Fatoum2020-09-281-2/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unadorned 0 is an int, but is printed used %zu. As it's just an interger literal, just hardcode it into the string. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | | Merge branch 'for-next/magicvar-unique-id' into masterSascha Hauer2020-10-142-15/+10
|\ \ \ \ | | |/ / | |/| |
| * | | magicvar: Replace BAREBOX_MAGICVAR_NAMED with BAREBOX_MAGICVARSascha Hauer2020-10-022-15/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | BAREBOX_MAGICVAR now generates a unique identifier automatically, so we can convert users of BAREBOX_MAGICVAR_NAMED to the simpler BAREBOX_MAGICVAR macro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/driver-macro' into masterSascha Hauer2020-10-14100-561/+123
|\ \ \
| * | | net: phy: Add and use driver register macroSascha Hauer2020-10-0112-68/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add driver registration macros for phy drivers similar to the existing platform device macros. This also changes the initcall level from fs_initcall to device_initcall for the phy drivers. It is not clear why the phy driver have been at fs_initcall in the first place, changing it shouldn't be a problem. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: pfuze: Use device_i2c_driver() macroSascha Hauer2020-09-291-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | Shorten driver registration by using the suitable macro. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | treewide: Use driver macroSascha Hauer2020-09-2987-481/+109
| |/ / | | | | | | | | | | | | | | | | | | We have several macros for a oneline driver registration. Add some missing and use them consistently where possible througout the tree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/dev-drvdata' into masterSascha Hauer2020-10-1412-94/+75
|\ \ \
| * | | driver: migrate some from dev_get_drvdata to device_get_match_dataAhmad Fatoum2020-10-096-14/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dev_get_drvdata instances here all store a valid pointer in the match data and can be readily converted. Do so. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | video: imx-hdmi: fix dev_get_drvdata misuseAhmad Fatoum2020-10-091-31/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The driver has a couple of issues in how it handles match data: - First use of dev_get_drvdata is superfluous as result is unused - Second use of dev_get_drvdata stores a sizeof(const void *) into an enum typed object - hdmi->dev_type contains a truncated pointer to a struct dw_hdmi_data and compares it with an enum, which will always fail Fix these and while it, refactor the code a bit to get rid of dw_hdmi_data, whose only other member is unused. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | mtd: nand-mxs: fix out-of-bounds write on 64-bit SoCsAhmad Fatoum2020-10-091-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Probing the nand_mxs device driver on 64 bit systems invokes undefined behavior, because of an errant cast. Fix this. No change of behavior for 32-bit SoCs intended. On error, type == 0 == GPMI_MXS as it used to. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | aiodev: lm75: fix out-of-bounds write on 64-bit SoCsAhmad Fatoum2020-10-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Probing the lm75 device driver on 64 bit systems invokes undefined behavior, because of an errant cast. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | dma: apbh: fix out-of-bounds write on 64-bit SoCsAhmad Fatoum2020-10-091-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | i.MX8 MM & MN are both ARM64 SoCs with a device compatible with "fsl,imx28-dma-apbh". Probing the barebox device driver on these SoCs would invoke undefined behavior however, because of an errant cast. Fix this. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | led: pca955x: fix probing from device treeAhmad Fatoum2020-10-091-40/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev->id_entry is not populated for devices probed from the device tree. It was used unconditionally however. Use device_get_match_data instead to support device tree probing. While at it, remove the array and the enum, we can store pointers to the correct chipdef structs directly. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | driver: introduce less error-prone dev_get_drvdata alternativeAhmad Fatoum2020-10-091-0/+11
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use dev_get_drvdata to get the driver match data associated with a device. This has two shortcomings: - Linux has dev_get_drvdata too, which returns a private pointer for driver specific info to associate with a device. We use dev->priv (or more often container_of) for that in barebox instead - It nearly always involves a cast to a double pointer, which is error-prone as size and alignment match need to be ensured on the programmer's part and can easily be gotten wrong: enum dev_type type; dev_get_drvdata(dev, (const void **)&type); // UB! Add a new function that instead of using a double pointer argument, returns the pointer directly: - For normal pointer driver data, no cast is necessary - For integer driver data casted to a pointer for storage, the cast is still necessary, but it's only a single pointer this way Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/deep-probe-prepare' into masterSascha Hauer2020-10-149-23/+32
|\ \ \
| * | | of: platform: fix of_amba_device_create stub return valueMarco Felsch2020-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stub should have the same function signature as the non-stub function. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: treewide: drop local device_d referenceMarco Felsch2020-09-293-20/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drop the local reference for each driver since the regulator_dev can handle this now. Attention: The pfuze is out of scope since this driver is not really a regulator driver. While on it fix a few minor style issues on the bcm2835 driver too. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: add device reference to regulator_devMarco Felsch2020-09-295-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is useful to know the physical device a regulator_dev belongs to. This is at least needed for the new deep-probe mechanism. It is also useful for a few regulator drivers to drop their own device_d reference. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: stpmic1: fix registering missed regulatorsMarco Felsch2020-09-291-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dts regulators subnode can be incomplete e.g. if the pre-programmed values are valid and shouldn't be changed. Missing regulator nodes are indicated by "of_regulator_match->of_node == NULL". Take missing regulators into account and register only existing ones. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: test of_regulator_register input before accessing itMarco Felsch2020-09-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add simple parameter check to avoid possible NULL pointer dereferences. Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | regulator: improve of_regulator_register error handlingMarco Felsch2020-09-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't ignore errors from __regulator_register(). Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | spi: core: don't ignore register_device failuresMarco Felsch2020-09-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add missing error handling for spi_new_device(). Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | | video: ssd1307fb: fix VBAT supply idMarco Felsch2020-09-291-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | The regulator id should be given without the "-supply" suffix else the core is searching for "vbat-supply-supply". Fixes: bf8f62d334 ("video/ssd1307fb: add support for VBAT") Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/clang-analyzer' into masterSascha Hauer2020-10-147-27/+57
|\ \ \ | |_|/ |/| |
| * | reset: remove dead initializationAhmad Fatoum2020-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | rstc is never read before written, so just drop the initializer. Reported-by: clang-analyzer-10 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | USB: musb: remove dead storesAhmad Fatoum2020-10-021-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reading the interrupt registers has a side-effect, so their value need not be used for anythig. Storing it into a variable never read obfuscates this however. Cast to (void) for clarity. Reported-by: clang-analyzer-10 Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | net: usb: asix: propagate errors from MDIO accessorsAhmad Fatoum2020-10-021-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The primitives asix_mdio_write and asix_mdio_read use return errors, but are unchecked. Propagate them instead. Reported-by: clang-analyzer-10 [afa: Untested on real hardware] Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | watchdog: fix division-by-zero when clock rate == 0Ahmad Fatoum2020-10-023-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of storing the clk into the driver's device-specific private data, just store the rate and make sure it's != 0 on probe. This aligns us with what Linux does for the STM32 IWDG and DW WDT. Reported-by: clang-analyzer-10 Cc: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>