Only do the touch screen setup when the 'ti,wires' property is present.

While here fix a typo in a debug message.
This commit is contained in:
Luiz Otavio O Souza 2016-05-26 18:52:26 +00:00
parent 4a6675067d
commit d3dd020425

View File

@ -732,7 +732,7 @@ ti_adc_attach(device_t dev)
sc->sc_charge_delay = DEFAULT_CHARGE_DELAY;
/* Read "tsc" node properties */
child = ofw_bus_find_child(node, "tsc");
if (child != 0) {
if (child != 0 && OF_hasprop(child, "ti,wires")) {
if ((OF_getprop(child, "ti,wires", &cell, sizeof(cell))) > 0)
sc->sc_tsc_wires = fdt32_to_cpu(cell);
if ((OF_getprop(child, "ti,coordinate-readouts", &cell, sizeof(cell))) > 0)
@ -745,7 +745,7 @@ ti_adc_attach(device_t dev)
sizeof(*wire_configs), (void **)&wire_configs);
if (nwire_configs != sc->sc_tsc_wires) {
device_printf(sc->sc_dev,
"invalid nubmer of ti,wire-config: %d (should be %d)\n",
"invalid number of ti,wire-config: %d (should be %d)\n",
nwire_configs, sc->sc_tsc_wires);
OF_prop_free(wire_configs);
return (EINVAL);