Delete field and related data (field_delete_field, field_delete_instance) I want to delete field from my Content Type using hook_update and wondering how to do it in most correct way.

I know that my field is only on 1 Content Type (page).

Here is my current solution.

function site_deployment_update_7001() {
  $fieldname = 'field_landing_page';

  if ($field = field_info_instance('node', $fieldname, 'page')) {
      field_delete_instance($field);
  }

  if ($field = field_info_field($fieldname)) {
    field_delete_field($field);
  }
}


However I'm a bit confused if I need to do field_delete_field after field_delete_instance. It's because on Drupal.org says that field_delete_instance doing field_delete_field as well (with condition: condition count($field['bundles']) == 0). I'm wondering about this condition, in what cases it is 0?

https://api.drupal.org/api/drupal/modules!field!field.crud.inc/function/field_delete_instance/7

function field_delete_instance($instance, $field_cleanup = TRUE) {
  // Mark the field instance for deletion.
  db_update('field_config_instance')-&gt;fields(array('deleted' =&gt; 1))-&gt;condition('field_name', $instance['field_name'])-&gt;condition('entity_type', $instance['entity_type'])-&gt;condition('bundle', $instance['bundle'])-&gt;execute();

  // Clear the cache.
  field_cache_clear();

  // Mark instance data for deletion.
  $field = field_info_field($instance['field_name']);
  module_invoke($field['storage']['module'], 'field_storage_delete_instance', $instance);

  // Let modules react to the deletion of the instance.
  module_invoke_all('field_delete_instance', $instance);

  // Delete the field itself if we just deleted its last instance.
  if ($field_cleanup &amp;&amp; count($field['bundles']) == 0) {
    field_delete_field($field['field_name']);
  }
}


Please advise what are the best approach to delete field. Thanks!
As fields can be attachted to differents bundles

field_delete_instance deletes the field itself only when there no more bundles using it. maybe see field_info_field and this comment from field_delete_instance to clarify

So if in 

 if ($field = field_info_instance('node', $fieldname, 'page')) {
   field_delete_instance($field);
 }


Applies and delete the last instance then in 

  if ($field = field_info_field($fieldname)) {
    field_delete_field($field);
  }


Should be null and wont execute field_delete_field($field);