/* Called when a ds1682 device is matched with this driver  */
static int ds1682_probe(struct i2c_client *client, const struct i2c_device_id *id)
/* Called when a ds1682 device is matched with this driver  */
static int ds1682_probe(struct i2c_client *client, const struct i2c_device_id *id)
{
	int rc;
	if (!i2c_check_functionality(client->adapter,
				     I2C_FUNC_SMBUS_I2C_BLOCK)) {
		dev_err(&client->dev, "i2c bus does not support the ds1682\n");
		rc = -ENODEV;
		goto exit;
	}
	rc = sysfs_create_group(&client->dev.kobj, &ds1682_group);
	if (rc)
		goto exit;
	rc = sysfs_create_bin_file(&client->dev.kobj, &ds1682_eeprom_attr);
	if (rc)
		goto exit_bin_attr;
	return 0;
 exit_bin_attr:
	sysfs_remove_group(&client->dev.kobj, &ds1682_group);
 exit:
	return rc;
}