]> git.sur5r.net Git - u-boot/blobdiff - drivers/misc/cros_ec_i2c.c
tools: mkimage: Call fclose in error path
[u-boot] / drivers / misc / cros_ec_i2c.c
index f9bc9750d4cb2e617eab6fb4f4dd126d64c9e2b5..3de18b2d2ade9e1a18e6e650358fa55747c425f3 100644 (file)
@@ -28,7 +28,7 @@ static int cros_ec_i2c_command(struct udevice *udev, uint8_t cmd,
                               int cmd_version, const uint8_t *dout,
                               int dout_len, uint8_t **dinp, int din_len)
 {
-       struct cros_ec_dev *dev = udev->uclass_priv;
+       struct cros_ec_dev *dev = dev_get_uclass_priv(udev);
        /* version8, cmd8, arglen8, out8[dout_len], csum8 */
        int out_bytes = dout_len + 4;
        /* response8, arglen8, in8[din_len], checksum8 */
@@ -139,12 +139,12 @@ static struct dm_cros_ec_ops cros_ec_ops = {
 };
 
 static const struct udevice_id cros_ec_ids[] = {
-       { .compatible = "google,cros-ec" },
+       { .compatible = "google,cros-ec-i2c" },
        { }
 };
 
 U_BOOT_DRIVER(cros_ec_i2c) = {
-       .name           = "cros_ec",
+       .name           = "cros_ec_i2c",
        .id             = UCLASS_CROS_EC,
        .of_match       = cros_ec_ids,
        .probe          = cros_ec_probe,